# slow read performance samba/cifs



## Boeri (Mar 17, 2011)

We are using FreeBSD bsd 9.0-HEAD-20110308-JPSNAP and samba version 3.5.6 

We are experiencing slow read speed over cifs compared to a much higher write speed.






We are using 14 disks in zfs striped mirrors, 10gbit connectors... Raw speed is not the problem. We use SSDs for ZIL and L2ARC cache. Most of the time, I find some articles about optimizing 1gbit connections but not for 10gbit connections. Samba is compiled with AIO support. Test client is windows 2008R2 client on xenserver 5.6 fp1 with nagle algorithm disabled. 


```
smb.conf
-----------
        socket options = SO_KEEPALIVE TCP_NODELAY IPTOS_LOWDELAY IPTOS_THROUGHPUT
        use sendfile=true
        write cache size = 65536
        aio write size = 65536
        aio read size = 65536
        aio write behind = true
        log file = /dev/null
        syslog = 0

sysctl
---------
net.inet.tcp.rfc1323: 1
net.inet.tcp.keepintvl: 75000
net.inet.tcp.sendspace: 262144
net.inet.tcp.recvspace: 262144
net.inet.tcp.read_locking: 1
net.inet.tcp.recvbuf_max: 16777216
net.inet.tcp.recvbuf_inc: 16384
net.inet.tcp.recvbuf_auto: 1
net.inet.tcp.sendbuf_max: 16777216
net.inet.tcp.sendbuf_inc: 8192
net.inet.tcp.sendbuf_auto: 1
net.inet.tcp.tso: 1
net.inet.tcp.local_slowstart_flightsize: 4
net.inet.tcp.slowstart_flightsize: 1
net.inet.tcp.path_mtu_discovery: 1
net.inet.tcp.sack.enable: 1

kern.ipc.maxsockbuf: 16777216

vfs.zfs.arc_meta_limit: 536870912
vfs.zfs.arc_meta_used: 533477328
vfs.zfs.arc_min: 536870912
vfs.zfs.arc_max: 9437184000

vm.kmem_map_free: 4463239168
vm.kmem_map_size: 3361370112
vm.kmem_size_scale: 1
vm.kmem_size_max: 10485760000
vm.kmem_size_min: 0
vm.kmem_size: 10485760000

vfs.zfs.vdev.min_pending: 4
vfs.zfs.vdev.max_pending: 33
```


----------

