summaryrefslogtreecommitdiffstats
path: root/source3/utils/testparm.c
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2013-11-04 12:32:46 +0100
committerDavid Disseldorp <ddiss@samba.org>2013-11-04 16:52:25 +0100
commit03e4037c5ea88e33c448e7fee256d7f11edbe486 (patch)
treeb073326f4eeb6573caaebcde7028c944022ab6a5 /source3/utils/testparm.c
parent8ae0f8c5985eea8c47b59848a8bdd0ff92082c7b (diff)
downloadsamba-03e4037c5ea88e33c448e7fee256d7f11edbe486.tar.gz
samba-03e4037c5ea88e33c448e7fee256d7f11edbe486.tar.xz
samba-03e4037c5ea88e33c448e7fee256d7f11edbe486.zip
testparm: Add warning for socket options.
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org> Autobuild-User(master): David Disseldorp <ddiss@samba.org> Autobuild-Date(master): Mon Nov 4 16:52:25 CET 2013 on sn-devel-104
Diffstat (limited to 'source3/utils/testparm.c')
-rw-r--r--source3/utils/testparm.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/source3/utils/testparm.c b/source3/utils/testparm.c
index ac60cbf990..1c13b52565 100644
--- a/source3/utils/testparm.c
+++ b/source3/utils/testparm.c
@@ -66,6 +66,7 @@ static int do_global_checks(void)
{
int ret = 0;
SMB_STRUCT_STAT st;
+ const char *socket_options;
if (lp_security() >= SEC_DOMAIN && !lp_encrypted_passwords()) {
fprintf(stderr, "ERROR: in 'security=domain' mode the "
@@ -133,6 +134,38 @@ static int do_global_checks(void)
}
/*
+ * Socket options.
+ */
+ socket_options = lp_socket_options();
+ if (socket_options != NULL &&
+ (strstr(socket_options, "SO_SNDBUF") ||
+ strstr(socket_options, "SO_RCVBUF") ||
+ strstr(socket_options, "SO_SNDLOWAT") ||
+ strstr(socket_options, "SO_RCVLOWAT") ||
+ strstr(socket_options, "TCP_NODELAY"))) {
+ fprintf(stderr,
+ "WARNING: socket options = %s\n"
+ "This warning is printed because you set one of the\n"
+ "following options: SO_SNDBUF, SO_RCVBUF, SO_SNDLOWAT,\n"
+ "SO_RCVLOWAT, TCP_NODELAY\n"
+ "Modern server operating systems are tuned for\n"
+ "high network performance in the majority of situations;\n"
+ "when you set 'socket options' you are overriding those\n"
+ "settings.\n"
+ "Linux in particular has an auto-tuning mechanism for\n"
+ "buffer sizes (SO_SNDBUF, SO_RCVBUF) that will be\n"
+ "disabled if you specify a socket buffer size. This can\n"
+ "potentially cripple your TCP/IP stack.\n\n"
+ "Getting the 'socket options' correct can make a big\n"
+ "difference to your performance, but getting them wrong\n"
+ "can degrade it by just as much. As with any other low\n"
+ "level setting, if you must make changes to it, make\n "
+ "small changes and test the effect before making any\n"
+ "large changes.\n\n",
+ socket_options);
+ }
+
+ /*
* Password server sanity checks.
*/