本着榨盡PC最後一點油水的思想,在看到mount能夠有一個noatime選項能夠提升文件系統性能時,我堅決果斷就挽起袖子動起手來。app
noatime是Linux下文件系統的一個mount選項,表示在讀文件時不去更改文件的access time屬性了,而缺省時每次讀文件,都要更新這個文件的last access time屬性,至關於附加了額外的寫操做,想一想對性能應該有不小的影響啊。ide
動手前,天然先測一下當前的性能,我用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)post
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)spa
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/secorm
改這個noatime卻是很簡單,在/etc/fstab中的文件系統的屬性後加上noatime,再用 sudo mount -oremount / 就能夠當即生效了(是的,不須要重啓)。用mount命令驗證,確實有了noatime的選項。rem