The following Samba options will affect performance if they're set incorrectly, much like the debug level. They're mentioned here so you will know what to look out for:
-
hide files
-
Providing a pattern to identify files hidden by the Windows client
hide
files
will result in any file matching the pattern being passed to the client with the DOS hidden attribute set. It requires a pattern match per file when listing directories, and slows the server noticeably.
-
lpq cache time
-
If your
lpq
(printer queue contents) command takes a long time to complete, you should increase
lpq
cache
time
to a value higher than the actual time required for
lpq
to execute, so as to keep Samba from starting a new query when one's already running. The default is 10 seconds, which is reasonable.
-
strict locking
-
Setting the
strict
locking
option causes Samba to check for locks on every access, not just when asked to by the client. The option is primarily a bug-avoidance feature, and can prevent ill-behaved DOS and Windows applications from corrupting shared files. However, it is slow and should typically be avoided.
-
strict sync
-
Setting
strict
sync
will cause Samba to write each packet to disk and wait for the write to complete whenever the client sets the sync bit in a packet. Windows 98 Explorer sets the bit in all packets transmitted, so if you turn this on, anyone with Windows 98 will think Samba servers are horribly slow.
-
sync always
-
Setting
sync
always
causes Samba to flush every write to disk. This is good if your server crashes constantly, but the performance costs are immense. SMB servers normally use oplocks and automatic reconnection to avoid the ill effects of crashes, so setting this option is not normally necessary.
-
wide links
-
Turning off
wide
links
prevents Samba from following symbolic links in one file share to files that are not in the share. It is turned on by default, since following links in Unix is not a security problem. Turning it off requires extra processing on every file open. If you do turn off wide links, be sure to turn on
getwd
cache
to cache some of the required data.
There is also a
follow
symlinks
option that can be turned off to prevent following any symbolic links at all. However, this option does not pose a performance problem.
-
getwd cache
-
This option caches the path to the current directory, avoiding long tree-walks to discover it. It's a nice performance improvement on a printer server or if you've turned off
wide
links
.