Skip to Content

What Is ZFS Compression?

To store more data on a ZFS file system, the ZFS compression strategy is a lightweight feature that works specifically on Linux-based servers. You can use ZFS on Linux operating systems such as Solaris, MacOS, Ubuntu, and FreeBSD. Network attached storage (NAS) administrators can use ZFS compression on systems such as TrueNAS.

What Is ZFS Compression?

Administrators can use ZFS compression quickly using a few commands, and the tool will reduce the storage size necessary to save data. The goal is to reduce file storage and allow additional data to be stored on the device. ZFS compression is specifically designed for the ZFS file system available on Linux-based machines.

The ZFS compression tool tells you exactly how much space you save after compressing files. Using the statistics, administrators can identify if compressed files are saving enough space to make it worth their while to continue using compression. For large enterprise servers, it’s generally beneficial to use compression to save money and resources.

How ZFS Compression Works

ZFS compression is completely invisible to the user, so only administrators are aware of file compression. Although using compression increases resource usage, users should not see a change in storage speed. It’s important to note that files themselves are not compressed. Instead, ZFS compression compresses based on record. A record in file storage is a collection of files.

When a file is saved, the file itself is not compressed, but the record is initially compressed before being stored. If ZFS cannot compress the file, the file is stored in its uncompressed form to avoid losing data. The amount of compression is set using various algorithms. For example, the lz4 compression algorithm uses a ratio of 1.61. The gzip algorithm uses a ratio of 2.27. Administrators can also set their own compression rate.

Benefits of Using ZFS Compression

The biggest benefit of using ZFS compression is the savings on storage space. With compression, you can store more data in the same amount of storage space. A company can save money on infrastructure by not having to buy more storage space.  

Cost savings is often the indirect benefit most corporations experience. With large NAS environments, compression can save several gigabytes in storage. Storage is expensive, so using ZFS compression can save corporations thousands in additional hardware and infrastructure costs.

How to Enable ZFS Compression

Administrators first need to enable ZFS compression. Operating systems disable ZFS compression by default. Here’s an example command to enable ZFS compression on Ubuntu:

zfs set compression=lz4 newvol

Notice that compression is configured for “newvol.” Data stored on this volume will be compressed. You should change the name of “newvol” to your own volume name to enable compression. You can always disable ZFS compression later if you determine that it’s slowing down system performance.

Common Use Cases for ZFS Compression

Enterprise storage is usually a distributed system using a NAS. Administrators with large storage silos can save several gigabytes of storage. They reduce the amount of space being used, so users can save more files without notifications that they have no more storage space available. 

Using compression takes a toll on computing resources, so administrators should test their environment before deploying ZFS compression to all storage devices. Administrators will see a spike in CPU usage, even in environments with plenty of computing power. As long as the server environment can handle the increase in CPU usage, the savings on storage costs will offset the CPU expense.

Conclusion

For corporations with high storage costs, using ZFS compression can help reduce those costs. ZFS compression is only available for Linux systems, so Windows administrators must work with a different compression algorithm. The ZFS compression algorithm is mainly used in enterprise applications where NAS and distributed storage is used.

Pure Storage supports cost savings and energy savings from compression. Learn how our Purity operating environment and FlashArray™ systems can fit in with your ZFS compression strategies.

03/2025
Automating Distribution Centers with All-Flash
Discover why Carozzi chose Pure Storage to meet the data demands of automating its distribution center with automated guided vehicles.
Case Study
3 pages

Browse key resources and events

RESORTS WORLD LAS VEGAS | JUNE 17 - 19
Pure//Accelerate® 2025

Join us June 17 - 19 and level up your data success.

Register Now
THOUGHT LEADERSHIP
Betting against Data Gravity: A Fool's Errand

Dive into global namespaces and the history of related buzzwords that appear as a response to data gravity.

Read the Article
PURE360 DEMOS
Explore, Learn, and Experience

Access on-demand videos and demos to see what Pure Storage can do.

Watch Demos
ANALYST REPORT
Stop Buying Storage, Embrace Platforms Instead

Explore the requirements, components, and selection process for new enterprise storage platforms.

Get the Report
CONTACT US
Contact PureInfo icon
Calendar icon
Meet with an Expert

Let’s talk. Book a 1:1 meeting with one of our experts to discuss your specific needs.

Chat icon
Questions, Comments?

Have a question or comment about Pure products or certifications?  We’re here to help.

Key icon
Schedule a Demo

Schedule a live demo and see for yourself how Pure can help transform your data into powerful outcomes. 

Call Sales: 800-976-6494

Mediapr@purestorage.com

 

Pure Storage, Inc.

2555 Augustine Dr.

Santa Clara, CA 95054

800-379-7873 (general info)

info@purestorage.com

CLOSE
CloseClose X icon
Your Browser Is No Longer Supported!

Older browsers often represent security risks. In order to deliver the best possible experience when using our site, please update to any of these latest browsers.