[PATCH 1/2] testparm: Add warning for socket options.

Volker Lendecke Volker.Lendecke at SerNet.DE
Mon Oct 21 03:57:18 MDT 2013


On Mon, Oct 21, 2013 at 11:42:35AM +0200, Andreas Schneider wrote:
> Signed-off-by: Andreas Schneider <asn at samba.org>
> ---
>  source3/utils/testparm.c | 27 ++++++++++++++++++++++++++-
>  1 file changed, 26 insertions(+), 1 deletion(-)
> 
> diff --git a/source3/utils/testparm.c b/source3/utils/testparm.c
> index a9793ab..598f589d 100644
> --- a/source3/utils/testparm.c
> +++ b/source3/utils/testparm.c
> @@ -126,6 +126,29 @@ cannot be set in the smb.conf file. nmbd will abort with this setting.\n");
>  	}
>  
>  	/*
> +	 * Socket options.
> +	 */
> +	if (lp_socket_options()) {
> +		fprintf(stderr,
> +			"WARNING: socket options = %s\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 that will be disabled if you specify a\n"
> +			"socket buffer size. This can potentially cripple your\n"
> +			"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",
> +			lp_socket_options());
> +	}
> +
> +	/*

This on is too strict IMHO. There are legitimate uses of
"socket options". See TCP_KEEPCNT, TCP_KEEPIDLE and
TCP_KEEPINTVL. Those are I believe valid to use if you want
quick detection of dead peers. If you restrict his to
SO_SNDBUF and SO_RCVBUF I'd be fine with it.

Volker

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de


More information about the samba-technical mailing list