[zfs-discuss] Relation between L2ARC and RAM size

Edward Ned Harvey (zfsonlinux) zfsonlinux at nedharvey.com
Wed Feb 7 06:48:30 EST 2018

> From: zfs-discuss [mailto:zfs-discuss-bounces at list.zfsonlinux.org] On Behalf
> Of Amir Christopher Najmi via zfs-discuss
> Every record in the l2arc consumes 70 Bytes of space in the ARC.
> Generally, the l2arc attempts to cache only random IO, so as a first cut on size
> you might try assuming all of the records are 4K.
> 1TB drive = 10^9 Bytes ( decimal power!)
> (10^9 Bytes / 4096 kB per record) * (70 Bytes per Record) * ( 1/1024 Bytes per
> kB) * (1/1024 Bytes per MB) = 16.3 MB of memory
> Without accounting for any of the details of things like kernel page sizing etc.

That's the hard way to calculate it. Who needs to be that precise?   ;-)

The easy way is: Just assume 1/50. Of course it will vary some based on your usage patterns, but it's a pretty good estimate. If you have 1TB L2ARC, assume it will consume 20GB ram. How does that compare with Richard's lower bound estimate of 16.3GB plus kernel page and other stuff?  ;-)  (He wrote the wrong unit of MB on there; he meant GB; the actual flaw is 1TB = 10^12 bytes). It's pretty close. The 50:1 rule of thumb actually works pretty well.

More information about the zfs-discuss mailing list