From 75f3da76e48df79c21e65354768d3f581053127e Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Tue, 16 Aug 2011 18:20:51 -0400 Subject: s3-prefork: Improve heuristics Signed-off-by: Andreas Schneider Signed-off-by: Simo Sorce --- source3/lib/server_prefork.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'source3/lib/server_prefork.c') diff --git a/source3/lib/server_prefork.c b/source3/lib/server_prefork.c index 71441c3303..d63e6a1673 100644 --- a/source3/lib/server_prefork.c +++ b/source3/lib/server_prefork.c @@ -279,7 +279,7 @@ int prefork_retire_children(struct prefork_pool *pfp, return j; } -int prefork_count_active_children(struct prefork_pool *pfp, int *total) +int prefork_count_children(struct prefork_pool *pfp, int *active) { int i, a, t; @@ -292,15 +292,18 @@ int prefork_count_active_children(struct prefork_pool *pfp, int *total) t++; - if (pfp->pool[i].num_clients <= 0) { + if ((pfp->pool[i].status == PF_WORKER_EXITING) || + (pfp->pool[i].num_clients <= 0)) { continue; } a++; } - *total = t; - return a; + if (active) { + *active = a; + } + return t; } static void prefork_cleanup_loop(struct prefork_pool *pfp) -- cgit