现在的位置: 首页 > 综合 > 正文

mount的noatime选项

2019年08月13日 ⁄ 综合 ⁄ 共 1217字 ⁄ 字号 评论关闭

mount的noatime选项

本着榨尽PC最后一点油水的思想,在看到mount可以有一个noatime选项可以提高文件系统性能时,我毫不犹豫就挽起袖子动起手来。

noatime是Linux下文件系统的一个mount选项,表示在读文件时不去更改文件的access
time属性了,而缺省时每次读文件,都要更新这个文件的last access
time属性,相当于附加了额外的写操作,想想对性能应该有不小的影响啊。

动手前,自然先测一下当前的性能,我用hdparm -tT和postmark(这个可以用apt-get安装)分别测了一下,
postmark
的结果是:
PostMark v1.51 : 8/14/01
pm>run
Creating files…Done
Performing
transactions……….Done
Deleting files…Done
Time:
        1
seconds total
        1 seconds of transactions (500 per second)

Files:
        764 created (764 per second)
               
Creation alone: 500 files (500 per second)
                Mixed with
transactions: 264 files (264 per second)
        243 read (243 per
second)
        257 appended (257 per second)
        764 deleted
(764 per second)
                Deletion alone: 528 files (528 per
second)
                Mixed with transactions: 236 files (236 per
second)

Data:
        1.36 megabytes read (1.36 megabytes per second)
       
4.45 megabytes written (4.45 megabytes per second)

hdparm的结果是:
 Timing cached reads:   1170 MB in  2.00 seconds =
585.12 MB/sec
 Timing buffered disk reads:   84 MB in  3.00 seconds
=  27.96 MB/sec

改这个noatime倒是很简单,在/etc/fstab中的文件系统的属性后加上noatime,再用 sudo mount
-oremount / 就可以立即生效了(是的,不需要重启)。用mount命令验证,确实有了noatime的选项。

现在再测(心情激动的说),啊,嗯,哎。。。结果几乎一模一样,确认没有搞错步骤之后,只能失望的写一篇blog安慰一下了,有希望借此提高性能的
同学,我劝你们也别忙活了,否则可能是和我一样失望了。

抱歉!评论已关闭.