I'm using Samba to share a folder from Linux to a Windows client (Windows Server 2012 R2). The disk backing the Linux share is pretty fast (NAS of 500+ MB/s). However, when I benchmark the IO performance from Windows machine, I can only get around 200 MB/s.

Here is what I have tried so far:

  1. Set these options (improve from 100 MB/s to 200 MB/s)

    aio read size = 1
    aio write size = 1
    aio write behind = true
  2. Set these options (no improvement)

    socket options=SO_RCVBUF=131072 SO_SNDBUF=131072 TCP_NODELAY

What can I do do to improve the IO performance?

  • What kind of network connection do you have between the machines? And what tests/benchmarks do you run to get 500 MB/sec to the NAS? – Andrew Henle May 23 '16 at 21:46
  • Thanks, @AndrewHenle I have 10 GbE network. And both dd, fio, iozone was used to benchmark the NAS. – Archer May 23 '16 at 22:24
  • You have a lot of variables in your setup. How do you access the NAS disks? NFS? And how are you benchmarking from the WIndows SMB client(s)? There's going to be some performance hit as you're adding the latency of another network hop along with the overhead of Samba, and that performance hit is going to be highly dependent on the specifics of your configuration and the IO pattern you're benchmarking. And this link says to set aio read/write size to 2048. – Andrew Henle May 24 '16 at 9:49

Set these below settings in smb.conf file [global] section:

socket options = TCP_NODELAY SO_RCVBUF=65536 SO_SNDBUF=65536
read raw = yes
write raw = yes
max xmit = 65535
dead time = 15
getwd cache = yes

and restart the smbd service to activate this settings by run service smb restart or service smbd restart.

| improve this answer | |
  • The answer should explain what is the expected impact of the settings and why they are better than the defaults. – sebasth Oct 2 '19 at 15:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.