Zpool atime turned off effect on Garbage Collection

dbayer

Well-Known Member
Apr 15, 2016
69
8
48
54
Hello,

I'm reading in the documentation that Garbage Collection uses atime with file touching to not delete any chunks from the last 24 Hours.

If the underlying zpool has atime turned off will this be problem for garbage collection?

I would imagine this would be a concern for most people as best practice recommends turning it off for ZFS.

Thanks,
Daniel
 
  • Like
Reactions: Tmanok
Hey Daniel,

you're right, but the GC relies on atime to be enabled.
 
Hi Hannes,

So do I need atime turned on for the datastorage pool? Or do I need it turned on for the original storage that is being backed up?

Also, does anyone know what kind of performance hit you get with atime turned on?

Thanks,
Daniel
 
Hey Daniel,

the datastorage pool has to have atime enabled, note that it is on by default, so if you didn't change it you don't have to change anything. You might get slightly better reads if atime is disabled, since atime won't be updated after every file access.
 
Hi Hannes,

So do I need atime turned on for the datastorage pool? Or do I need it turned on for the original storage that is being backed up?

Also, does anyone know what kind of performance hit you get with atime turned on?

Thanks,
Daniel

Well, it depends on your configuration.
If your PBS datastore is in a ZFS dataset then you need only to turn ATIME on on the dataset
zfs set atime=on POOLNAME/BACKUPDATASET

If you use the entire pool as PBS datastore, then you need to enable it on the pool.
zfs set atime=on POOLNAME
 
yeah, we account for relatime when doing a garbage collection.
 
  • Like
Reactions: RolandK
yeah, we account for relatime when doing a garbage collection.
If I create a datastore from a new disk of type "Directory" then is mounted as relatime
/dev/sdg1 on /mnt/datastore/bktestext4 type ext4 (rw,relatime)
while if I create of type "ZFS" the resulting dataset has "atime on" and "relatime off"
zfs get all bkpool02 | grep 'time' bkpool02 atime on default bkpool02 relatime off default
is it a bug?
 
Why do you think its a bug? atime=on means the access time is always set which is more precise because each single read will cause a write but that also creates alot of additional IOPS and SSD wear. So an alternative would be to switch off atime and enable relatime instead. In that case the access time is only updated less frequent. So if PBS can handle relatime a "atime=on" should work too.
 
@mmenaz, if creation of a datastore from pbs with ext4 creates mount with relatime and zfs does NOT, then i would tell this a bug, yes. (as it has severe performance implication, especially when using hdd instead of ssd).

i would file a bugticket in proxmox bugzilla then.
 
@mmenaz, if creation of a datastore from pbs with ext4 creates mount with relatime and zfs does NOT, then i would tell this a bug, yes. (as it has severe performance implication, especially when using hdd instead of ssd).

i would file a bugticket in proxmox bugzilla then.
There is a very similar problem about the installer and the zpool created, so I've added my user case there
https://bugzilla.proxmox.com/show_bug.cgi?id=3703
 
... So an alternative would be to switch off atime and enable relatime instead. ...
Please note that on ZFS atime needs to be enabled for relatime to work. In other words: atime=off, relatime=on is the same as atime=off,relatime=off. I do believe this is the opposite of ext4, where relatime is separate from atime and can be enabled when atime is off.
 
  • Like
Reactions: Neobin and Dunuin
Let me just understand something w.r.t. this: *IF* I turned off atime (ie. atime=off), then my GC "should" delete all chunks older than 24H as no atime would be updated during the GC marking phase, thus my backups older than 24Hours that I wanted to keep, will be corrupted, correct?
 
Let me just understand something w.r.t. this: *IF* I turned off atime (ie. atime=off), then my GC "should" delete all chunks older than 24H as no atime would be updated during the GC marking phase, thus my backups older than 24Hours that I wanted to keep, will be corrupted, correct?
After initially scaring me nearly to death, it seems it's not that bad. If I read this post correctly https://forum.proxmox.com/threads/pbs-server-full-two-days-later-almost-empty.83274/post-366927 then @dcsapak says that GC updates the atime explicitly (e.g. it doesn't rely on a read access to update atime, see link below). That does explain why our PBS is running fine while not having atime enabled.

https://git.proxmox.com/?p=proxmox-...564f7e029dc48304b3aa1293a0f815c9;hb=HEAD#l179
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!