ZFS flush ARC without a reboot

Hi All,

Except to chnage the value of
Code:
vfs.zfs.arc_free_target
, Is there other solution ?
And, can we do the same for L2ARC ?

Thanks !
N!
 
No, I don't know a way, but I'm not a ZFS expert (just very satisfied user), and in particular I have never looked at the source code.

If you explain why you want to do that, maybe we can figure out something? AFAIK, the ARC and L2ARC only contain read caches (not dirty data a.k.a. write caches). So flushing them will not harden your data to disk, it will only affect performance and memory usage. Deliberately flushing read caches is not something that's commonly done in normal operation (yes, I know there are exceptions involving manually managing caches when the user knows more about application semantics than the file system can infer). It is often used as part of benchmarking, but that is a very dangerous way of creating biased benchmark numbers.
 
Hi ralphbsz,

You found out, its exactly to do some benchmark and more specifically, to check how much ARC increase performance.

but vfs.zfs.arc_free_target seems to not work :/

Best regards,
N!
 
Last edited:
Not sure if it would work, or if it's even allowed, but you could try setting vfs.zfs.arc_max to 0.
 
to check how much ARC increase performance.
Not that I‘ve ever tested it, but no matter how huge your ARC size is, if the cached data is discarded before an attempt is made to reread that piece of data, there‘s zero gain.
The otherway around, if you got small ARC size, but reread the same piece of data often (before it is discarded due to other data getting cached) there is a gain. So the use case should be more important than ARC size itself.
IMO in a home environment with only a single user a massive ARC size and the read ahead functionality give you little gain.
 
Hi Sirdice,

It was a good idea, but that's not allowed :

Code:
sysctl vfs.zfs.arc_max=0 
vfs.zfs.arc_max: 483183820800
sysctl: vfs.zfs.arc_max=0: Invalid argument

k.jacker, yeah, agree with you, i think there is a misunderstanding (du to my bad english), we dont want to find a "good" ARC size, but just try to know how performance are better with our current ARC at some point.
And to do that, we just want to flush ARC in a current usage of the server instead of to reboot it.

Best regards,
N!
 
Back
Top