Linux command – mount 參數 directio


mount 我常常用,但他的參數千千萬萬種,用過的就那幾個.同事說有一個參數 directio – 可以加快 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 // /fs1
Password for root@//
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 // /fs1
Password for root@//

不過試用了一下,似乎對於效能沒有很明顯的差異.有沒有加參數跑 iometer 大概都是 6x.x MBs 左右.



發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *

這個網站採用 Akismet 服務減少垃圾留言。進一步了解 Akismet 如何處理網站訪客的留言資料