Setting the noatime flag for filesystems inside an lxc container

Solution 1:

  1. It does make a difference. atime in the container functions as you would expect it to, having a negative impact on the performance.
  2. According to this ticket you need to use a workaround, using a mount hook instead of having LXC doing the mount for you

Solution 2:

My guess is that when a system call writes to a file, the kernel code that implements that looks at the noatime flag's status and gets that info from the same kernel routine that provides the info to proc filesystem.

However, that's far from an authoritative view, and if it matters, you should verify it.

Does the atime actually get updated? Check in both the host and hosted system. I doubt the time is recorded differently, but again, that's a guess.

Depending how long you need to count on the answer being correct, you might also need to go hunting for an authoritative answer on what the behaviour is supposed to be. If this is not currently working as intended, it might change in future, and remember that LXC is still not all that far past it's first production release. Asking questions can help stabilise the answer, but maybe take it to an LXC developer list?