diff options
author | Andrew Bartlett <abartlet@samba.org> | 2008-02-04 17:59:16 +1100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2008-02-04 17:59:16 +1100 |
commit | b3c5fbec47739ee2bb26f900d1f564a36dc3ad82 (patch) | |
tree | 6cbde07fd634a515b2f7fece08f36abc13b4be3d /source4/smbd/process_standard.c | |
parent | 3d5594e74da375a47cf15514926803352d256ca3 (diff) | |
download | samba-b3c5fbec47739ee2bb26f900d1f564a36dc3ad82.tar.gz samba-b3c5fbec47739ee2bb26f900d1f564a36dc3ad82.tar.bz2 samba-b3c5fbec47739ee2bb26f900d1f564a36dc3ad82.zip |
Remaining changes to implement the prefork process model
To use, run 'smbd -M prefork'
By default, only the smb service is preforked. 4 children are
created, and all listen for new connections. The Linux Kernel 'wake
one' behaviour should ensure that only one is given the oportunity to
accept. We need to look into the ideal number of worker children, as
well as load balancing behaviours.
To change, set:
prefork children : smb = 6
valid service names (smb in this example) match those in 'server services'.
Andrew Bartlett and David Disseldorp
(This used to be commit 35313c0aa3fbfdd943edfb7bafd7645b1a0c54e9)
Diffstat (limited to 'source4/smbd/process_standard.c')
-rw-r--r-- | source4/smbd/process_standard.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/source4/smbd/process_standard.c b/source4/smbd/process_standard.c index c088ea3b1a..deb44c0a68 100644 --- a/source4/smbd/process_standard.c +++ b/source4/smbd/process_standard.c @@ -127,8 +127,8 @@ static void standard_accept_connection(struct event_context *ev, talloc_free(c); talloc_free(s); - /* setup this new connection */ - new_conn(ev2, lp_ctx, sock2, cluster_id(pid), private); + /* setup this new connection. Cluster ID is PID based for this process modal */ + new_conn(ev2, lp_ctx, sock2, cluster_id(pid, 0), private); /* we can't return to the top level here, as that event context is gone, so we now process events in the new event context until there are no @@ -144,6 +144,7 @@ static void standard_accept_connection(struct event_context *ev, */ static void standard_new_task(struct event_context *ev, struct loadparm_context *lp_ctx, + const char *service_name, void (*new_task)(struct event_context *, struct loadparm_context *lp_ctx, struct server_id , void *), void *private) { @@ -179,10 +180,10 @@ static void standard_new_task(struct event_context *ev, /* Ensure that the forked children do not expose identical random streams */ set_need_random_reseed(); - setproctitle("task server_id[%d]", pid); + setproctitle("task %s server_id[%d]", service_name, pid); - /* setup this new connection */ - new_task(ev2, lp_ctx, cluster_id(pid), private); + /* setup this new task. Cluster ID is PID based for this process modal */ + new_task(ev2, lp_ctx, cluster_id(pid, 0), private); /* we can't return to the top level here, as that event context is gone, so we now process events in the new event context until there are no |