Axel Luttgens:
[default open file rlim_max = 9223372036854775807]

Thanks for doing the experiments. On 64-bit systems the number
9223372036854775807 equals RLIM_INFINITY. This implies that 
MacOS X does not enforce the open file limit.

This rlim_max value breaks a heuristic that Postfix uses to increase
the number of open files to the hard limit (Postfix expects that
rlim_max will always be smaller than INT_MAX, and tries to set the
current (rlim_cur) limit to no more than that value).

Below is a patch that fixes the heuristic. When the system reports
an RLIM_INFINITY hard limit for the number of open files, there is
no need for Postfix to update the open file limit, because it is
not enforced.

Please give this a try, and report if this cures the problem.

BTW looks like this file hasn't changed in a long time.

        Wietse

*** src/util/open_limit.c-      Fri Dec 11 13:55:29 1998
--- src/util/open_limit.c       Thu Mar 21 15:28:49 2013
***************
*** 62,68 ****
  #ifdef RLIMIT_NOFILE
      if (getrlimit(RLIMIT_NOFILE, &rl) < 0)
        return (-1);
!     if (limit > 0) {
        if (limit > rl.rlim_max)
            rl.rlim_cur = rl.rlim_max;
        else
--- 62,69 ----
  #ifdef RLIMIT_NOFILE
      if (getrlimit(RLIMIT_NOFILE, &rl) < 0)
        return (-1);
!     /* Don't update the limit when it is not enforced. */
!     if (limit > 0 && rl.rlim_max != RLIM_INFINITY) {
        if (limit > rl.rlim_max)
            rl.rlim_cur = rl.rlim_max;
        else

Reply via email to