fat                                      Wed, 19 May 2010 18:37:25 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=299504

Log:
- set hard and soft limit (instead of only the soft limit) when setting 
rlimit_core or rlimit_files
- remove the debug log about getrlimit on the main process wich is meaningless 
when rlmit_* settings are set

Changed paths:
    U   php/php-src/trunk/sapi/fpm/fpm/fpm_unix.c

Modified: php/php-src/trunk/sapi/fpm/fpm/fpm_unix.c
===================================================================
--- php/php-src/trunk/sapi/fpm/fpm/fpm_unix.c   2010-05-19 17:58:50 UTC (rev 
299503)
+++ php/php-src/trunk/sapi/fpm/fpm/fpm_unix.c   2010-05-19 18:37:25 UTC (rev 
299504)
@@ -150,21 +150,20 @@
        if (wp->config->rlimit_files) {
                struct rlimit r;

-               getrlimit(RLIMIT_NOFILE, &r);
-               r.rlim_cur = (rlim_t) wp->config->rlimit_files;
-//             r.rlim_max = (rlim_t) wp->config->rlimit_files;
+               r.rlim_max = r.rlim_cur = (rlim_t) wp->config->rlimit_files;
+
                if (0 > setrlimit(RLIMIT_NOFILE, &r)) {
-                       zlog(ZLOG_STUFF, ZLOG_SYSERROR, "[pool %s] 
setrlimit(RLIMIT_NOFILE) failed", wp->config->name);
+                       zlog(ZLOG_STUFF, ZLOG_SYSERROR, "[pool %s] 
setrlimit(RLIMIT_NOFILE, %d) failed (%d)", wp->config->name, 
wp->config->rlimit_files, errno);
                }
        }

        if (wp->config->rlimit_core) {
                struct rlimit r;

-               getrlimit(RLIMIT_CORE, &r);
-               r.rlim_cur = wp->config->rlimit_core == -1 ? (rlim_t) 
RLIM_INFINITY : (rlim_t) wp->config->rlimit_core;
+               r.rlim_max = r.rlim_cur = wp->config->rlimit_core == -1 ? 
(rlim_t) RLIM_INFINITY : (rlim_t) wp->config->rlimit_core;
+
                if (0 > setrlimit(RLIMIT_CORE, &r)) {
-                       zlog(ZLOG_STUFF, ZLOG_SYSERROR, "[pool %s] 
setrlimit(RLIMIT_CORE) failed", wp->config->name);
+                       zlog(ZLOG_STUFF, ZLOG_SYSERROR, "[pool %s] 
setrlimit(RLIMIT_CORE, %d) failed (%d)", wp->config->name, 
wp->config->rlimit_core, errno);
                }
        }

@@ -248,14 +247,6 @@
        }

        fpm_stdio_init_final();
-
-       {
-               struct rlimit r;
-               getrlimit(RLIMIT_NOFILE, &r);
-
-               zlog(ZLOG_STUFF, ZLOG_NOTICE, "getrlimit(nofile): max:%lld, 
cur:%lld",
-                       (long long) r.rlim_max, (long long) r.rlim_cur);
-       }
        return 0;
 }
 /* }}} */

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to