1 | <samba:parameter name="socket options"
|
---|
2 | context="G"
|
---|
3 | type="string"
|
---|
4 | constant="1"
|
---|
5 | xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
|
---|
6 | <description>
|
---|
7 | <para>
|
---|
8 | <warning>
|
---|
9 | <para>Modern server operating systems are tuned for high
|
---|
10 | network performance in the majority of situations; when you set socket
|
---|
11 | options you are overriding those settings. Linux in particular has an
|
---|
12 | auto-tuning mechanism for buffer sizes that will be disabled if you
|
---|
13 | specify a socket buffer size. This can potentially cripple your
|
---|
14 | TCP/IP stack.</para>
|
---|
15 |
|
---|
16 | <para> Getting the socket options correct can make a big difference to
|
---|
17 | your performance, but getting them wrong can degrade it by just as
|
---|
18 | much. As with any other low level setting, if you must make changes
|
---|
19 | to it, make small changes and <emphasis>test</emphasis> the effect
|
---|
20 | before making any large changes.</para>
|
---|
21 | </warning>
|
---|
22 | </para>
|
---|
23 |
|
---|
24 | <para>This option allows you to set socket options
|
---|
25 | to be used when talking with the client.</para>
|
---|
26 |
|
---|
27 | <para>Socket options are controls on the networking layer
|
---|
28 | of the operating systems which allow the connection to be
|
---|
29 | tuned.</para>
|
---|
30 |
|
---|
31 | <para>This option will typically be used to tune your Samba server
|
---|
32 | for optimal performance for your local network. There is no way
|
---|
33 | that Samba can know what the optimal parameters are for your net,
|
---|
34 | so you must experiment and choose them yourself. We strongly
|
---|
35 | suggest you read the appropriate documentation for your operating
|
---|
36 | system first (perhaps <command moreinfo="none">man
|
---|
37 | setsockopt</command> will help).</para>
|
---|
38 |
|
---|
39 | <para>You may find that on some systems Samba will say
|
---|
40 | "Unknown socket option" when you supply an option. This means you
|
---|
41 | either incorrectly typed it or you need to add an include file
|
---|
42 | to includes.h for your OS. If the latter is the case please
|
---|
43 | send the patch to <ulink url="mailto:samba-technical@lists.samba.org">
|
---|
44 | samba-technical@lists.samba.org</ulink>.</para>
|
---|
45 |
|
---|
46 | <para>Any of the supported socket options may be combined
|
---|
47 | in any way you like, as long as your OS allows it.</para>
|
---|
48 |
|
---|
49 | <para>This is the list of socket options currently settable
|
---|
50 | using this option:</para>
|
---|
51 |
|
---|
52 | <itemizedlist>
|
---|
53 | <listitem><para>SO_KEEPALIVE</para></listitem>
|
---|
54 | <listitem><para>SO_REUSEADDR</para></listitem>
|
---|
55 | <listitem><para>SO_BROADCAST</para></listitem>
|
---|
56 | <listitem><para>TCP_NODELAY</para></listitem>
|
---|
57 | <listitem><para>TCP_KEEPCNT *</para></listitem>
|
---|
58 | <listitem><para>TCP_KEEPIDLE *</para></listitem>
|
---|
59 | <listitem><para>TCP_KEEPINTVL *</para></listitem>
|
---|
60 | <listitem><para>IPTOS_LOWDELAY</para></listitem>
|
---|
61 | <listitem><para>IPTOS_THROUGHPUT</para></listitem>
|
---|
62 | <listitem><para>SO_REUSEPORT</para></listitem>
|
---|
63 | <listitem><para>SO_SNDBUF *</para></listitem>
|
---|
64 | <listitem><para>SO_RCVBUF *</para></listitem>
|
---|
65 | <listitem><para>SO_SNDLOWAT *</para></listitem>
|
---|
66 | <listitem><para>SO_RCVLOWAT *</para></listitem>
|
---|
67 | <listitem><para>SO_SNDTIMEO *</para></listitem>
|
---|
68 | <listitem><para>SO_RCVTIMEO *</para></listitem>
|
---|
69 | <listitem><para>TCP_FASTACK *</para></listitem>
|
---|
70 | <listitem><para>TCP_QUICKACK</para></listitem>
|
---|
71 | <listitem><para>TCP_NODELAYACK</para></listitem>
|
---|
72 | <listitem><para>TCP_KEEPALIVE_THRESHOLD *</para></listitem>
|
---|
73 | <listitem><para>TCP_KEEPALIVE_ABORT_THRESHOLD *</para></listitem>
|
---|
74 | <listitem><para>TCP_DEFER_ACCEPT *</para></listitem>
|
---|
75 | </itemizedlist>
|
---|
76 |
|
---|
77 | <para>Those marked with a <emphasis>'*'</emphasis> take an integer
|
---|
78 | argument. The others can optionally take a 1 or 0 argument to enable
|
---|
79 | or disable the option, by default they will be enabled if you
|
---|
80 | don't specify 1 or 0.</para>
|
---|
81 |
|
---|
82 | <para>To specify an argument use the syntax SOME_OPTION = VALUE
|
---|
83 | for example <command moreinfo="none">SO_SNDBUF = 8192</command>. Note that you must
|
---|
84 | not have any spaces before or after the = sign.</para>
|
---|
85 |
|
---|
86 | <para>If you are on a local network then a sensible option
|
---|
87 | might be:</para>
|
---|
88 |
|
---|
89 | <para><command moreinfo="none">socket options = IPTOS_LOWDELAY</command></para>
|
---|
90 |
|
---|
91 | <para>If you have a local network then you could try:</para>
|
---|
92 |
|
---|
93 | <para><command moreinfo="none">socket options = IPTOS_LOWDELAY TCP_NODELAY</command></para>
|
---|
94 |
|
---|
95 | <para>If you are on a wide area network then perhaps try
|
---|
96 | setting IPTOS_THROUGHPUT. </para>
|
---|
97 |
|
---|
98 | <para>Note that several of the options may cause your Samba
|
---|
99 | server to fail completely. Use these options with caution!</para>
|
---|
100 | </description>
|
---|
101 |
|
---|
102 | <value type="default">TCP_NODELAY</value>
|
---|
103 | <value type="example">IPTOS_LOWDELAY</value>
|
---|
104 | </samba:parameter>
|
---|