diff options
author | Simo Sorce <idra@samba.org> | 2011-08-16 18:20:51 -0400 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2011-08-21 09:05:05 -0400 |
commit | 75f3da76e48df79c21e65354768d3f581053127e (patch) | |
tree | bdc84c408d80a121f9231114129f87980db0940a /source3/lib/server_prefork.c | |
parent | 89dde6b7fce3342c828f166e7d76bf4656939ee4 (diff) | |
download | samba-75f3da76e48df79c21e65354768d3f581053127e.tar.gz samba-75f3da76e48df79c21e65354768d3f581053127e.tar.bz2 samba-75f3da76e48df79c21e65354768d3f581053127e.zip |
s3-prefork: Improve heuristics
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
Diffstat (limited to 'source3/lib/server_prefork.c')
-rw-r--r-- | source3/lib/server_prefork.c | 11 |
1 files changed, 7 insertions, 4 deletions
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) |