From 3f8d83b75390bd6525a3eb8009854d3b854fd54d Mon Sep 17 00:00:00 2001 From: Tim Beale Date: Thu, 31 Jan 2019 12:08:00 +1300 Subject: [PATCH] samba: Change default process model to prefork Prefork is the more sensible default option now, as it better handles a large number of client connections. Signed-off-by: Tim Beale Reviewed-by: Andrew Bartlett --- WHATSNEW.txt | 13 +++++++++++++ docs-xml/manpages/samba.8.xml | 4 ++-- source4/smbd/server.c | 2 +- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/WHATSNEW.txt b/WHATSNEW.txt index a3ed9213d50..85c417a61a9 100644 --- a/WHATSNEW.txt +++ b/WHATSNEW.txt @@ -16,6 +16,19 @@ UPGRADING NEW FEATURES/CHANGES ==================== +Default samba process model +--------------------------- + +The default for the --model argument passed to the samba executable has changed +from 'standard' to 'prefork'. This means a difference in the number of samba +child processes that are created to handle client connections. The previous +default would create a separate process for every LDAP or NETLOGON client +connection. For a network with a lot of persistent client connections, this +could result in significant memory overhead. Now, with the new default of +'prefork', the LDAP, NETLOGON, and KDC services will create a fixed number of +worker processes at startup and share the client connections amongst these +workers. The number of worker processes can be configured by the 'prefork +children' setting in the smb.conf (the default is 4). REMOVED FEATURES ================ diff --git a/docs-xml/manpages/samba.8.xml b/docs-xml/manpages/samba.8.xml index 0d542b2fbc8..8d548d85fdd 100644 --- a/docs-xml/manpages/samba.8.xml +++ b/docs-xml/manpages/samba.8.xml @@ -119,8 +119,8 @@ for each new client connection. prefork - A process is started for each Samba service, and a - fixed number of worker processes are started for those + The default. A process is started for each Samba service, + and a fixed number of worker processes are started for those services that support it (currently LDAP, NETLOGON, and KDC). The client connections are then shared amongst the worker processes. diff --git a/source4/smbd/server.c b/source4/smbd/server.c index cf860491c1a..ea421b3bd68 100644 --- a/source4/smbd/server.c +++ b/source4/smbd/server.c @@ -452,7 +452,7 @@ static int binary_smbd_main(const char *binary_name, init_module_fn *shared_init; uint16_t stdin_event_flags; NTSTATUS status; - const char *model = "standard"; + const char *model = "prefork"; int max_runtime = 0; struct stat st; enum { -- 2.34.1