mount – https://benjr.tw/23515 我常常用,但他的參數千千萬萬種,用過的就那幾個.同事說有一個參數 directio – http://linux.die.net/man/8/mount.cifs 可以加快 samba 分享的網路硬碟速度,用 #man mount 查了一下關於 directio 的敘述.
Do not do inode data caching on files opened on this mount. This precludes mmaping files on this mount. In some cases with fast networks and little or no caching benefits on the client (e.g. when the application is doing large sequential reads bigger than page size without rereading the same data) this can provide better performance than the default behavior which caches reads (readahead) and writes (writebehind) through the local Linux client pagecache if oplock (caching token) is granted and held. Note that direct allows write operations larger than page size to be sent to the server. On some kernels this requires the cifs.ko module to be built with the CIFS_EXPERIMENTAL configure option.
This option is will be deprecated in 3.7. Users should use cache=none instead on more recent kernels.
不過最後一行提到核心 3.7 就不再用這一個參數了,改用 cache=none 這一參數,難怪我在 Ubuntu 14.04(kernel 3.13.0-24) 下不能用 directio 這個參數.
root@benjr:~# mount.cifs -o directio //172.16.0.46/samba /fs1 Password for root@//172.16.0.46/samba: mount error(22): Invalid argument Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) root@benjr:~# mount.cifs -o cache=none //172.16.0.46/samba /fs1 Password for root@//172.16.0.46/samba:
不過試用了一下,似乎對於效能沒有很明顯的差異.有沒有加參數跑 iometer 大概都是 6x.x MBs 左右.