httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject svn commit: r817772 - in /httpd/mod_fcgid/trunk: CHANGES-FCGID docs/manual/mod/mod_fcgid.xml modules/fcgid/fcgid_bridge.c modules/fcgid/fcgid_conf.c modules/fcgid/fcgid_pm_main.c
Date Tue, 22 Sep 2009 19:02:46 GMT
Author: trawick
Date: Tue Sep 22 19:02:41 2009
New Revision: 817772

URL: http://svn.apache.org/viewvc?rev=817772&view=rev
Log:
Termination of idle processes after inactivity timeout can now be 
disabled by setting FCGIDIdleTimeout to 0.  Termination of idle
processes based on the process lifetime can now be disabled by setting
FCGIDProcessLifeTime to 0.  FCGIDMaxRequestsPerProcess now accepts 0
for unlimited.

Submitted by: Ricardo Cantu <ricardo smartcsc.com>
Reviewed by: trawick

Modified:
    httpd/mod_fcgid/trunk/CHANGES-FCGID
    httpd/mod_fcgid/trunk/docs/manual/mod/mod_fcgid.xml
    httpd/mod_fcgid/trunk/modules/fcgid/fcgid_bridge.c
    httpd/mod_fcgid/trunk/modules/fcgid/fcgid_conf.c
    httpd/mod_fcgid/trunk/modules/fcgid/fcgid_pm_main.c

Modified: httpd/mod_fcgid/trunk/CHANGES-FCGID
URL: http://svn.apache.org/viewvc/httpd/mod_fcgid/trunk/CHANGES-FCGID?rev=817772&r1=817771&r2=817772&view=diff
==============================================================================
--- httpd/mod_fcgid/trunk/CHANGES-FCGID [utf8] (original)
+++ httpd/mod_fcgid/trunk/CHANGES-FCGID [utf8] Tue Sep 22 19:02:41 2009
@@ -1,6 +1,12 @@
                                                          -*- coding: utf-8 -*-
 Changes with mod_fcgid 2.3.2
 
+  *) Termination of idle processes after inactivity timeout can now be 
+     disabled by setting FCGIDIdleTimeout to 0.  Termination of idle 
+     processes based on the process lifetime can now be disabled by setting
+     FCGIDProcessLifeTime to 0.  FCGIDMaxRequestsPerProcess now accepts 0
+     for unlimited.  [Ricardo Cantu <ricardo smartcsc.com>]
+
   *) All directives have been renamed in order to use a common prefix "FCGID".
      Underscores in directive names have been eliminated in favor of
      CamelCase. The old directive names will still work but are deprecated.

Modified: httpd/mod_fcgid/trunk/docs/manual/mod/mod_fcgid.xml
URL: http://svn.apache.org/viewvc/httpd/mod_fcgid/trunk/docs/manual/mod/mod_fcgid.xml?rev=817772&r1=817771&r2=817772&view=diff
==============================================================================
--- httpd/mod_fcgid/trunk/docs/manual/mod/mod_fcgid.xml (original)
+++ httpd/mod_fcgid/trunk/docs/manual/mod/mod_fcgid.xml Tue Sep 22 19:02:41 2009
@@ -606,7 +606,8 @@
     <contextlist><context>server config</context></contextlist>
     <usage>
       <p>Application processes which have not handled a request
-      for this period of time will be terminated.</p>
+      for this period of time will be terminated.  A value of <code>0</code>
+      disables the check.</p>
     </usage>
   </directivesynopsis>
 
@@ -686,12 +687,17 @@
     <name>FCGIDMaxRequestsPerProcess</name>
     <description>Max requests handled by each FastCGI application</description>
     <syntax>FCGIDMaxRequestsPerProcess <em>value</em></syntax>
-    <default>FCGIDMaxRequestsPerProcess -1</default>
+    <default>FCGIDMaxRequestsPerProcess 0</default>
     <contextlist><context>server config</context> <context>virtual
host</context></contextlist>
     <usage>
       <p>FastCGI application processes will be terminated after handling
-      the specified number of requests.  A value of <code>-1</code>
+      the specified number of requests.  A value of <code>0</code>
       disables the check.</p>
+      <note type="hint"><title>Note</title>
+      <p>A value of <code>-1</code> is currently accepted for ease of
+      migration for existing configurations.  It is treated the same as
+      <code>0</code>.</p>
+      </note>
     </usage>
   </directivesynopsis>
 
@@ -744,7 +750,8 @@
     <contextlist><context>server config</context></contextlist>
     <usage>
       <p>Idle application processes which have existed for greater
-      than this time will be terminated.</p>
+      than this time will be terminated.  A value of <code>0</code>
+      disables the check.</p>
     </usage>
   </directivesynopsis>
 

Modified: httpd/mod_fcgid/trunk/modules/fcgid/fcgid_bridge.c
URL: http://svn.apache.org/viewvc/httpd/mod_fcgid/trunk/modules/fcgid/fcgid_bridge.c?rev=817772&r1=817771&r2=817772&view=diff
==============================================================================
--- httpd/mod_fcgid/trunk/modules/fcgid/fcgid_bridge.c (original)
+++ httpd/mod_fcgid/trunk/modules/fcgid/fcgid_bridge.c Tue Sep 22 19:02:41 2009
@@ -193,7 +193,7 @@
             ctx->procnode->diewhy = FCGID_DIE_COMM_ERROR;
             return_procnode(s, ctx->procnode,
                             1 /* communication error */ );
-        } else if (sconf->max_requests_per_process != -1
+        } else if (sconf->max_requests_per_process
                    && ++ctx->procnode->requests_handled >=
                    sconf->max_requests_per_process) {
             ctx->procnode->diewhy = FCGID_DIE_LIFETIME_EXPIRED;

Modified: httpd/mod_fcgid/trunk/modules/fcgid/fcgid_conf.c
URL: http://svn.apache.org/viewvc/httpd/mod_fcgid/trunk/modules/fcgid/fcgid_conf.c?rev=817772&r1=817771&r2=817772&view=diff
==============================================================================
--- httpd/mod_fcgid/trunk/modules/fcgid/fcgid_conf.c (original)
+++ httpd/mod_fcgid/trunk/modules/fcgid/fcgid_conf.c Tue Sep 22 19:02:41 2009
@@ -47,7 +47,7 @@
 #define DEFAULT_IPC_CONNECT_TIMEOUT 3
 #define DEFAULT_IPC_COMM_TIMEOUT 40
 #define DEFAULT_OUTPUT_BUFFERSIZE 65536
-#define DEFAULT_MAX_REQUESTS_PER_PROCESS -1
+#define DEFAULT_MAX_REQUESTS_PER_PROCESS 0
 #define DEFAULT_MAX_REQUEST_LEN (1024*1024*1024)    /* 1G */
 #define DEFAULT_MAX_MEM_REQUEST_LEN (1024*64)   /* 64k */
 #define DEFAULT_WRAPPER_KEY "ALL"
@@ -472,7 +472,9 @@
     server_rec *s = cmd->server;
     fcgid_server_conf *config =
         ap_get_module_config(s->module_config, &fcgid_module);
-    config->max_requests_per_process = atol(arg);
+    if ((config->max_requests_per_process = atol(arg)) == -1) {
+        config->max_requests_per_process = 0;
+    }
     config->max_requests_per_process_set = 1;
     return NULL;
 }

Modified: httpd/mod_fcgid/trunk/modules/fcgid/fcgid_pm_main.c
URL: http://svn.apache.org/viewvc/httpd/mod_fcgid/trunk/modules/fcgid/fcgid_pm_main.c?rev=817772&r1=817771&r2=817772&view=diff
==============================================================================
--- httpd/mod_fcgid/trunk/modules/fcgid/fcgid_pm_main.c (original)
+++ httpd/mod_fcgid/trunk/modules/fcgid/fcgid_pm_main.c Tue Sep 22 19:02:41 2009
@@ -59,7 +59,8 @@
     /* Should I check the idle list now? */
     if (procmgr_must_exit()
         || apr_time_sec(now) - apr_time_sec(lastidlescan) <=
-        sconf->idle_scan_interval)
+        sconf->idle_scan_interval
+        || (!sconf->idle_timeout && !sconf->proc_lifetime))
         return;
     lastidlescan = now;
 
@@ -74,17 +75,17 @@
         next_node = &proc_table[current_node->next_index];
         last_active_time = current_node->last_active_time;
         start_time = current_node->start_time;
-        if ((apr_time_sec(now) - apr_time_sec(last_active_time) >
-             sconf->idle_timeout
-             || apr_time_sec(now) - apr_time_sec(start_time) >
-             sconf->proc_lifetime)
+        if (((sconf->idle_timeout && 
+              (apr_time_sec(now) - apr_time_sec(last_active_time) > sconf->idle_timeout))
+             || (sconf->proc_lifetime && 
+              (apr_time_sec(now) - apr_time_sec(start_time) > sconf->proc_lifetime)))
             && is_kill_allowed(main_server, current_node)) {
             /* Set die reason for log */
-            if (apr_time_sec(now) - apr_time_sec(last_active_time) >
-                sconf->idle_timeout)
+            if (sconf->idle_timeout &&
+                (apr_time_sec(now) - apr_time_sec(last_active_time) > sconf->idle_timeout))
                 current_node->diewhy = FCGID_DIE_IDLE_TIMEOUT;
-            else if (apr_time_sec(now) - apr_time_sec(start_time) >
-                     sconf->proc_lifetime)
+            else if (sconf->proc_lifetime && 
+                     (apr_time_sec(now) - apr_time_sec(start_time) > sconf->proc_lifetime))
                 current_node->diewhy = FCGID_DIE_LIFETIME_EXPIRED;
 
             /* Unlink from idle list */



Mime
View raw message