Does ZFS cache Compressed or Uncompressed data in a ZFS file-system with compression turned on

cachecompressionfilesystemszfs

ZFS supports file-system compression and it also caches frequently or recently accessed data.

If a system has lots of CPU but the underlying data storage system is slow. It is possible that ZFS would perform better with compression turned on. This can be easily tested when writing files by measuring CPU and disk usage and throughput. (of course latency may exist,, but this would not be an issue for large files).

But what about cache? If data will have to be decompressed every time it is read then this is probably less of a good idea.

Is the cached data compressed?. Does anybody have some information on this?

Best Answer

I asked Richard Elling, ex-sun ZFS engineer this question. He told me L2ARC is uncompressed, just like the ARC is uncompressed.

Sorry, I can't provide documentation or specifications. My only proof is that one of the guys who helped design ZFS told me in person when I met him last week. :)