Hacker News new | ask | show | jobs
by viraptor 1501 days ago
> Most subvolumes can be mounted with noatime, except for /home where I frequently need to sort files by modification time.

That doesn't sound right. Noatime turns off recording of the last access time, not modification.

2 comments

> Most subvolumes can be mounted with noatime

This noatime thing is an old-wive's tale that needs to die.

AFAIK, most "modern" filesystems (XFS,BTRFS etc.) all default to relatime

relatime maintains atime but without the overhead

EDIT TO ADD:

Actually,I've just done a bit of searching .... relatime has been the kernel mount default since >= 2.6.30 ! [1]

[1] https://kernelnewbies.org/Linux_2_6_30 (scroll to 1.11. Filesystems performance improvements)

> but without the overhead

The cost of atime is an extra write every time you read something.

Relatime changes this to one atime update per day (by default), low enough that it usually doesn't matter.

However, that update per day may have significant impact when you are using Copy-on-Write filesystems (btrfs, zfs). Each time the atime field is updated you are creating a new metadata block for that file. Old blocks can be reclaimed by the garbage collector (at an extra cost), but not if they exist in some snapshot.

All of this means that if you use btrfs/zfs and have lots of small files and take snapshots at least once per day, there's a noticeable performance difference between relative and noatime.

I've been using noatime everywhere for several years and I've never noticed any downside. This is definitely my recommended solution.

If you don't use atime, there's no need to keep it around. Daily or otherwise. Unless you have reason to believe an application uses atime, it probably doesn't.

I've used noatime by default, except for few cases where I know it is used, in professional settings for probably two decades. Hopefully you know what kind of appliciation you are running. There are many parameters in a system and this is just one of them.

The only times I've seen atime used has been for a two queues, and only in the case of "has this file changes since last it was read". And that is precisely what relatime is for, the daily update is just an optional extra.

I prefer lazyatime.
AFAIK those are independent features, I use both noatime and lazytime.
IIRC, noatime is useful everywhere except /var/spool or /var/mail where certain daemons may depend on access time correctness.
You can't depend on access time correctness... Because someone else can come along and grep through all your files and now they're all accessed right now.
That's the theory. In practice for example courier IMAP relied (still relies?) on at least relatime for some notification aspects.
Perhaps it just triggers some wasted CPU time, as opposed to incorrect behavior.