# Trying to improve Samba performance!

## Cyker

I've been storing more and more of my stuff on my RAID array, including Windows games, and it's getting very clear that Samba and Windows do not like each other much!

Some workloads are fine, mainly reads and small scattered writes, but certain types of write really kill Samba performance; The worst examples I've had so far have been installing Fallout 3 and doing a Ghost with a file on the RAID as target - What should be moving along at 30MB/s+ ends up doing ~1MB/s!

Doing the same Ghost op from a USB drive to another - Traditionally a slow op - still outperforms Samba by an order of magnitude!

This is the stuff I've tried so far:

```
socket options = IPTOS_LOWDELAY TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192 ;No noticeable change

        max xmit = 65535 ;No noticeable change

        aio read size = 16384 ;Seems to help reduce latency, e.g. streaming music off while doing large sustained file transfers

        aio write size = 16384 ;Seems to help reduce latency, e.g. streaming music off while doing large sustained file transfers

        block size = 4096 ;Helps correct block calculations in Windows; Does nothing for performance

        write cache size = 65535 ;No noticeable change

        strict sync = No ;Faster than =Yes, mainly when copying lots of small files

        strict allocate = Yes
```

strict allocate is a tricky one; For the Fallout and Ghost tests, enabling it helped claw back some speed (Roughly quadrupled it in fact, but that still only means 4MB/s  :Sad:  ), but causes an initial massive spike of writes on the RAID Array, which jams up all the I/O for a short while (This may be related to my other problem with CFQ tho'.).

However, it seemed to negatively impact Linux clients slightly, but I didn't test that as much so it might have been a fluke...

I've been told that using XFS would be much faster than ext3/4, but doing that conversion would be nigh-on impossible for me!  :Surprised:   :Laughing: 

Anyone out there have a favourite optimization trick for Windows<->Samba interop?

----------

## msalerno

Have you looked into windows?  Most of the time you need to look at both ends.

Based on your post, I'm guessing you have already read this, but just in case.

Is it a Gig network?  Jumbo frames enabled?

What about other protocols between the 2 systems?  FTP or SFTP?  Are they slow as well?

----------

## Cyker

Ha, I wouldn't even know where to begin tweaking the Windows side of SMB (*ahem*CIFS!  :Wink: )

The network is a bit of an eclectic mix, my server being the bridge between 1000BaseT, 100Base-TX and 10base2!!  :Laughing: 

Most protocols run at near-line speed to and from the server (Well, half line-speed for the gigabit stuff; Can't use jumbo frames so that hurts things a bit even with NAPI and off-loading!).

Samba is by far the most variable to/from the server. I could get 30-50MB/s for some stuff but 1MB/s for other stuff!

Copying stuff to/from using Explorer to the server is generally pretty fast, but it's usually some programs saving to the server where the speed losses are most pronounced.

Ghost and Installshield seem to be the worst offenders...

Edit: I should add that copying between, say, my Win98 and my Win2k box are also near line-speed; It's just their interaction with Samba that leaves things to be desired. For some reason, it likes Win98 more than 2K or XP tho'!  :Sad: 

----------

