惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

H
Help Net Security
月光博客
月光博客
IT之家
IT之家
B
Blog RSS Feed
T
Tailwind CSS Blog
The GitHub Blog
The GitHub Blog
博客园 - 三生石上(FineUI控件)
MyScale Blog
MyScale Blog
J
Java Code Geeks
Stack Overflow Blog
Stack Overflow Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - Franky
博客园 - 叶小钗
阮一峰的网络日志
阮一峰的网络日志
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
U
Unit 42
博客园_首页
B
Blog
V
V2EX
腾讯CDC
Vercel News
Vercel News
量子位
Microsoft Security Blog
Microsoft Security Blog

OneUptime Blog

How to Monitor Azure App Services (PaaS) with OpenTelemetry Grafana Stack vs OneUptime: DIY Observability or Unified Platform? Your AI Workloads Are About to Blow Up Your Observability Bill The Great Observability Consolidation Is Here How to Write Custom Object Classes for Ceph How to Write Custom Ceph Manager Modules How to Write a ceph.conf Configuration File How to Use Rook-Ceph with OpenShift How to Use Rook-Ceph with Longhorn for Comparison How to Configure Volume Snapshot Class for RBD in Rook How to Configure VolumeReplicationClass Scheduling Intervals in Rook How to Set Up Volume Replication with Rook-Ceph How to Create Volume Group Snapshots with Rook CSI How to Visualize Ceph Network Performance in Grafana How to Enable Virtual Host-Style Bucket Access in Rook How to View Runtime Configuration via Admin Socket How to View Quota Settings and Update Stats in Ceph RGW How to View PG Scaling Recommendations with autoscale-status How to View PG Distribution via Admin Socket How to View Performance Metrics in the Ceph Dashboard How to View OSD Performance Counters in Ceph How to View Connection Status via Admin Socket How to View Ceph Cluster Summary Dashboard via CLI How to Version Control Rook-Ceph Configuration How to Version Control Ceph Infrastructure with Terraform How to Verify Kubernetes Node Requirements for Rook-Ceph Deployment How to Verify Health Before and After Rook Upgrades How to Verify Data Integrity with Deep Scrubbing How to Verify Complete Rook-Ceph Cleanup How to Verify Backup Integrity from Ceph Snapshots
How to Understand When Compression Helps vs Hurts in Ceph
Nawaz Dhandala · 2026-03-31 · via OneUptime Blog

Compression Is Not Always Beneficial

While compression can dramatically reduce storage costs, enabling it indiscriminately causes problems:

  • CPU overhead on every write and read
  • Increased latency for incompressible data
  • Write amplification if compression increases blob size

Understanding when compression helps vs hurts is critical for designing a Ceph cluster that performs well across different workload types.

When Compression Helps

Text and Structured Data

Log files, JSON, XML, CSV, and database dumps typically achieve 3-5x compression:

# Test compression ratio on your data
zstd -c -v /var/log/app/*.log > /dev/null

Expected output:

/var/log/app/app.log : 14.93% (1.20 MB => 183.6 KB)

Sparse Files

Kubernetes PVCs with partially used filesystems contain many zero-filled pages that compress to nearly nothing.

Repetitive Data

Backups of similar snapshots, config files, and schema data compress very well.

When Compression Hurts

Already-Compressed Data

JPEG images, MP4 video, ZIP archives, tar.gz files, and encrypted data are either random-looking or already compressed. Compression adds CPU overhead with near-zero savings:

# Check compressibility of a file
lz4 -c /tmp/video.mp4 | wc -c
ls -la /tmp/video.mp4

If the compressed size is larger or equal to the original, disable compression.

High-Throughput NVMe Workloads

On very fast NVMe arrays, compression CPU overhead can become the bottleneck. Profile before enabling:

# Check OSD CPU usage
kubectl -n rook-ceph top pods -l app=rook-ceph-osd

If OSD CPU usage is above 70%, compression will degrade performance.

Small Random I/O

4KB random writes for databases are often partially compressible but the per-operation overhead of compression adds measurable latency.

Decision Framework

Is data text, JSON, logs, or CSV?
  --> YES: Use force mode with zstd
  --> NO:

Is data a database (Postgres, MySQL)?
  --> YES: Use aggressive mode with snappy (partial savings, low overhead)
  --> NO:

Is data images, video, or encrypted?
  --> YES: Use none (disable compression)
  --> NO:

Is workload write-heavy (>100K IOPS per OSD)?
  --> YES: Use lz4 or none
  --> NO: Use aggressive with snappy

Checking Actual Savings

Validate after enabling compression:

ceph df detail --format json | jq '.pools[] | {
  name: .name,
  ratio: (if .stats.compress_bytes_used > 0 then
    (.stats.compress_under_bytes / .stats.compress_bytes_used | . * 10 | round / 10)
  else 0 end)
}'

Disable compression on pools where ratio < 1.1:

ceph osd pool set media-pool compression_mode none

Summary

Compression helps significantly for text, logs, JSON, and sparse data, delivering 3-6x storage savings with minimal overhead. It hurts performance for pre-compressed data (images, video, encrypted files), very high-IOPS NVMe workloads, and small random write patterns. Use ceph df detail to measure actual compression ratios per pool and disable compression on any pool where savings are below 10%, freeing up CPU for more impactful work.