Hello,

my expire timeout patch

--
С уважением,
Роман Шишнёв,
ведущий инженер Active Technologies
----------------------------------------
Офис: +375 (17) 209-91-91, 209-90-06
http://www.atservers.com
diff -Nru a/server/mpm/experimental/peruser/peruser.c 
b/server/mpm/experimental/peruser/peruser.c
--- a/server/mpm/experimental/peruser/peruser.c 2006-04-16 13:24:41.495669137 
+0300
+++ b/server/mpm/experimental/peruser/peruser.c 2006-04-16 13:27:32.076667271 
+0300
@@ -1970,6 +1970,23 @@
 #endif
 static int hold_off_on_exponential_spawning;
 
+static int total_processes(int child_num)
+{
+    int i, total;
+
+    for(i = 0, total = 0; i < NUM_CHILDS; ++i)
+    {
+       if(CHILD_INFO_TABLE[i].senv == CHILD_INFO_TABLE[child_num].senv &&
+           (!(CHILD_INFO_TABLE[i].type == CHILD_TYPE_PROCESSOR &&
+               CHILD_INFO_TABLE[i].status == CHILD_STATUS_STANDBY)))
+       {
+           total++;
+       }
+    }
+
+    return total;
+}
+
 static void perform_idle_server_maintenance(apr_pool_t *p)
 {
     int i;
@@ -1990,7 +2007,8 @@
         (CHILD_INFO_TABLE[i].type == CHILD_TYPE_PROCESSOR ||
           CHILD_INFO_TABLE[i].type == CHILD_TYPE_WORKER) &&
         ap_scoreboard_image->parent[i].pid > 1 &&
-        ap_scoreboard_image->servers[i][0].status != SERVER_DEAD &&
+        ap_scoreboard_image->servers[i][0].status == SERVER_READY &&
+        (idle_processors (i) > 1 || total_processes (i) == 1) &&
         apr_time_sec(now - ap_scoreboard_image->servers[i][0].last_used) > 
expire_timeout)
       {
         CHILD_INFO_TABLE[i].pid = 0;
_______________________________________________
Peruser mailing list
[email protected]
http://www.telana.com/mailman/listinfo/peruser

Reply via email to