Apache Pulsar and S3 Tiered Storage: Balancing Offload Thresholds with Object Store Costs
0 reputation · 10 Oct 2025, 06:58 UTC
0 reputation · 10 Oct 2025, 06:58 UTC
Apache Pulsar supports tiered storage to move ledger segments from BookKeeper to external object stores like Amazon S3. For low-traffic workloads, reducing the offload threshold allows the system to minimize expensive disk usage by shifting data to cheaper object storage more aggressively.
While a low offload threshold reduces broker disk I/O and storage costs, it introduces a potential conflict with object store pricing models. Many cloud providers charge per request (PUT/GET), and moving very small ledger segments can result in a high volume of tiny objects. This may lead to increased API costs or provider throttling, potentially offsetting the savings gained from reduced disk usage.
Given a deployment using Pulsar 2.10+ and BookKeeper 4.7+, what is the recommended strategy for determining the minimum offload threshold that balances disk savings against object store request overhead? How does the system handle the trade-off between ledger segment size and S3 request costs for topics with minimal throughput?
33605 reputation · 10 Oct 2025, 13:08 UTC
For Pulsar 2.10+ with BookKeeper 4.7+, choose offloadThreshold so that low-throughput topics create only as many S3 objects as your request budget allows. Pulsar offloads a closed ledger segment to S3 once it exceeds the threshold, and each segment becomes one object. The broker does not pack small segments together, so a very low threshold multiplies PUT requests without reducing the total bytes stored.
offloadThreshold is a per-ledger size limit, not a global disk target.segmentSize controls when a ledger rolls; offload happens after the segment is closed and exceeds the threshold.S3 charges per PUT/GET request and per GB stored. BookKeeper disk is usually billed as a flat monthly rate per GB. Aggressive offloading trades predictable disk expense for variable API expense. At minimal throughput, segment count can dominate the bill even when total payload is small.
dailyBytes / segmentSize. Verify your BookKeeper segmentSize; defaults vary by release.offloadThreshold or increase segmentSize.offloadThreshold between 128 MB and 256 MB for low-traffic topics. Move toward 512 MB or higher if estimated daily segments reach the thousands.enableAutoOffload only when disk pressure is the main constraint, and tune autoOffloadThreshold as a disk-usage percentage.What is the average daily message volume in bytes for these topics? That figure determines whether 128 MB, 256 MB, or 512 MB is the correct minimum threshold.
This guidance assumes Pulsar 2.10+ and BookKeeper 4.7+. Parameter names and defaults can differ by release, so verify against your running version. S3 pricing varies by region and storage tier; cross-region data transfer costs are not included. Aggressive offloading can increase consumer read latency because S3 retrieval is slower than BookKeeper reads.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.