1 <samba:parameter xmlns:samba="http://samba.org/common">
2 <term><anchor id="SOCKETOPTIONS"/>socket options (G)</term>
3 <listitem><para>This option allows you to set socket options
4 to be used when talking with the client.</para>
6 <para>Socket options are controls on the networking layer
7 of the operating systems which allow the connection to be
10 <para>This option will typically be used to tune your Samba
11 server for optimal performance for your local network. There is
12 no way that Samba can know what the optimal parameters are for
13 your net, so you must experiment and choose them yourself. We
14 strongly suggest you read the appropriate documentation for your
15 operating system first (perhaps <command moreinfo="none">man setsockopt</command>
18 <para>You may find that on some systems Samba will say
19 "Unknown socket option" when you supply an option. This means you
20 either incorrectly typed it or you need to add an include file
21 to includes.h for your OS. If the latter is the case please
22 send the patch to <ulink url="mailto:samba@samba.org">
23 samba@samba.org</ulink>.</para>
25 <para>Any of the supported socket options may be combined
26 in any way you like, as long as your OS allows it.</para>
28 <para>This is the list of socket options currently settable
29 using this option:</para>
32 <listitem><para>SO_KEEPALIVE</para></listitem>
33 <listitem><para>SO_REUSEADDR</para></listitem>
34 <listitem><para>SO_BROADCAST</para></listitem>
35 <listitem><para>TCP_NODELAY</para></listitem>
36 <listitem><para>IPTOS_LOWDELAY</para></listitem>
37 <listitem><para>IPTOS_THROUGHPUT</para></listitem>
38 <listitem><para>SO_SNDBUF *</para></listitem>
39 <listitem><para>SO_RCVBUF *</para></listitem>
40 <listitem><para>SO_SNDLOWAT *</para></listitem>
41 <listitem><para>SO_RCVLOWAT *</para></listitem>
44 <para>Those marked with a <emphasis>'*'</emphasis> take an integer
45 argument. The others can optionally take a 1 or 0 argument to enable
46 or disable the option, by default they will be enabled if you
47 don't specify 1 or 0.</para>
49 <para>To specify an argument use the syntax SOME_OPTION = VALUE
50 for example <command moreinfo="none">SO_SNDBUF = 8192</command>. Note that you must
51 not have any spaces before or after the = sign.</para>
53 <para>If you are on a local network then a sensible option
55 <para><command moreinfo="none">socket options = IPTOS_LOWDELAY</command></para>
57 <para>If you have a local network then you could try:</para>
58 <para><command moreinfo="none">socket options = IPTOS_LOWDELAY TCP_NODELAY</command></para>
60 <para>If you are on a wide area network then perhaps try
61 setting IPTOS_THROUGHPUT. </para>
63 <para>Note that several of the options may cause your Samba
64 server to fail completely. Use these options with caution!</para>
66 <para>Default: <command moreinfo="none">socket options = TCP_NODELAY</command></para>
67 <para>Example: <command moreinfo="none">socket options = IPTOS_LOWDELAY</command></para>