samba:optimize_samba
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
samba:optimize_samba [2016/07/10 23:57] – peter | samba:optimize_samba [2019/12/04 19:00] (current) – removed peter | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Samba - Optimize Samba ====== | ||
- | |||
- | Samba, like any other program can use a little speed boost. | ||
- | |||
- | Samba needs to be tuned to your network because every enviorment offers its own unique set of challenges. | ||
- | |||
- | |||
- | ===== Network Socket Options ===== | ||
- | |||
- | The socket options configuration options are really host system tuning options, but they' | ||
- | |||
- | <code bash> | ||
- | socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536 | ||
- | </ | ||
- | |||
- | |||
- | **TCP_NODELAY** tells the server to send as many packets as necessary to keep delay low. This will account for a 30 percent speedup by itself. | ||
- | |||
- | **IPTOS_LOWDELAY** is another option trading off throughput for lower delay, but which affects routers and other systems, not the server. | ||
- | |||
- | **SO_SNDBUF** and **SO_RCVBUF** The send and receive buffers can often be the reset to a value higher than that of the operating system. | ||
- | |||
- | **SO_KEEPALIVE** initiates a periodic check every four(4) hours to see if the client is still there. | ||
- | |||
- | |||
- | ===== Raw read and write ===== | ||
- | |||
- | These are important performance configuration options; they enable Samba to use large reads and writes to the network, of up to 64KB in a single SMB request. | ||
- | |||
- | |||
- | ===== Opportunistic locking ===== | ||
- | |||
- | Opportunistic locks, or oplocks, allow clients to cache files locally, improving performance on the order of 30 percent. | ||
- | |||
- | |||
- | ===== Log level ===== | ||
- | |||
- | Samba produces a lot of debugging messages at level 3 and above, and writing them to disk or syslog is a slow operation. | ||
- | |||
- | |||
- | ===== Options to watch closely ===== | ||
- | |||
- | The following Samba options will affect performance if they are not set correctly. | ||
- | |||
- | **hide files** provide 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, | ||
- | |||
- | **lpq cache time** is used 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. | ||
- | |||
- | **strict locking** sets the strict locking option and causes Samba to check for locks on every access, not just when asked to by the client. | ||
- | |||
- | **strict sync** sets strict sync and 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. | ||
- | |||
- | **sync always** is used to "sync always" | ||
- | |||
- | **wide links** act by turning off wide links prevents Samba from following symbolic links in one file share to files that are not in the share. | ||
- | |||
- | **getwd cache** 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. | ||
- | |||
samba/optimize_samba.1468195033.txt.gz · Last modified: 2020/07/15 09:30 (external edit)