ZFS can compress data on filesystems. Some folks adamantly refuse to compress mounted filesystems, citing performance issues. While not every situation is appropriate, compression can increase system performance by improving IO at the cost of CPU. In most cases, disk IO, more than CPU, is rate determining. This tech-recipe describes turning on ZFS compression and checking its compression ratio status.
A great use for ZFS compression is a filesystem containing logs. A busy web server can generate massive log files. Enabling compression for log files makes sense because they are not heavy on read operations, text in logs compresses well, and substantially more log data can be stored online and made accessible.
To enable compression for the filesystem /techrx/logs, use the ZFS command:
zfs set compression=yes techrx/logs
If you want to know how well the compression is working, check it using this command:
zfs get compressionratio techrx/logs