2026-07-14

ZFS, L2ARC, and ARC Cache

ZFS, L2ARC, and ARC Cache

ZFS is a advanced file system and volume manager originally developed by Sun Microsystems. It is known for its data integrity features, snapshots, and sophisticated caching. Unlike traditional file systems like NTFS or ext4, ZFS combines the file system and the volume manager into one, giving it much more control over how data is stored and cached.

ARC stands for Adaptive Replacement Cache, and it is ZFS's primary read cache. ARC lives in system RAM and stores frequently accessed data. The adaptive part means that ARC automatically adjusts to your workload, learning which data is accessed most often and keeping that in memory. More RAM means a larger ARC, which means better performance for frequently accessed files.

L2ARC, or Level 2 ARC, extends the ARC by using a fast SSD as a secondary cache. When data is evicted from the ARC because it has not been accessed recently, it can be stored on the L2ARC drive instead of being discarded entirely. If that data is needed again, it can be read from the fast SSD instead of the slower main storage pool. L2ARC is not as fast as RAM, but it is much faster than reading from a hard drive pool.

ZFS also has a write cache called the ZIL, or ZFS Intent Log. The ZIL ensures that synchronous writes, like database transactions, are not lost in a power failure. You can accelerate the ZIL by using a separate fast SSD called a SLOG device. The SLOG does not store the actual data, it just stores the intent log, so it does not need to be large, but it needs to be very fast and power-safe.

Setting up ZFS caching requires careful planning. ARC uses system RAM, and ZFS will happily use all available RAM if you let it, which can starve other applications. You can set a maximum ARC size to prevent this. L2ARC also uses some RAM for its index, about 1 GB of RAM per 100 GB of L2ARC. For a home NAS, a reasonable setup is 16 GB of RAM for ARC and a 256 GB SSD for L2ARC.

Let's work together

Do you need more info, help with your project, or to develop an idea?

Whether it's an easy question, a quick doubt, or just a 5-minute chat, send me a message—it costs nothing and I'm always ready to help. I love discussing a problem to understand it, getting creative with solutions, and focusing on simple, reliable, and straightforward ideas that we can actuate quickly.

Contact me

Switch Topic

Choose a specialized topic to explore: