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

Scott Lovenberg scott.lovenberg at gmail.com
Tue Oct 22 09:06:35 MDT 2013


On Mon, Oct 21, 2013 at 5:57 AM, Volker Lendecke
<Volker.Lendecke at sernet.de> wrote:
> 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
>

+1 (but NAK on "!!!")
This was a warning I wrote (sans "!!!" :) a while back for the
smb.conf man page; other socket options to consider warning on are
SO_SNDLOWAT, SO_RCVLOWAT, and TCP_NODELAY.  In the client (I can't
speak for the server) IIRC, TCP_NODELAY has no effect since the client
explicitly uses TCP_CORK.

-- 
Peace and Blessings,
-Scott.


More information about the samba-technical mailing list