You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by lh...@apache.org on 2026/06/24 12:14:11 UTC

(pulsar-helm-chart) 01/05: Add example of faster disk cleanup

This is an automated email from the ASF dual-hosted git repository.

lhotari pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar-helm-chart.git

commit fce2efd7f4d7a732216d624b3d8bcfde9de998d1
Author: Lari Hotari <lh...@apache.org>
AuthorDate: Wed Jun 24 14:26:08 2026 +0300

    Add example of faster disk cleanup
---
 examples/README.md                       |  1 +
 examples/values-faster-disk-cleanup.yaml | 61 ++++++++++++++++++++++++++++++++
 2 files changed, 62 insertions(+)

diff --git a/examples/README.md b/examples/README.md
index fe1b330..0a75220 100644
--- a/examples/README.md
+++ b/examples/README.md
@@ -147,6 +147,7 @@ in examples that deploy a broker.
 | [`values-no-persistence.yaml`](values-no-persistence.yaml) | **Ephemeral.** Deploys stateful components with `emptyDir` instead of PVCs. All data is lost on pod restart / cluster shutdown. Sets `autoSkipNonRecoverableData` so BookKeeper tolerates the lost state. For throwaway testing/CI only. |
 | [`values-bookkeeper-aws.yaml`](values-bookkeeper-aws.yaml) | A 3-bookie cluster using AWS EBS (`gp2`) `PersistentVolumeClaims` for the BookKeeper journal and ledgers. Monitoring stack disabled. |
 | [`values-zookeeper-aws.yaml`](values-zookeeper-aws.yaml) | A configuration store running only ZooKeeper backed by AWS EBS (`gp2`) volumes, including the `externalZookeeperServerList` option for building a ZooKeeper cluster that spans namespaces/clusters. |
+| [`values-faster-disk-cleanup.yaml`](values-faster-disk-cleanup.yaml) | Tune BookKeeper and the broker to reclaim disk space faster: more frequent BookKeeper compaction/garbage collection with a smaller journal, and faster broker managed-ledger rollover so closed ledgers are trimmed sooner. Handy for space-constrained or test clusters. These are the same cleanup settings bundled into `values-testing.yaml`. |
 
 ### Security (TLS and authentication)
 
diff --git a/examples/values-faster-disk-cleanup.yaml b/examples/values-faster-disk-cleanup.yaml
new file mode 100644
index 0000000..0b17a51
--- /dev/null
+++ b/examples/values-faster-disk-cleanup.yaml
@@ -0,0 +1,61 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+# Faster disk cleanup settings for BookKeeper and the Pulsar broker.
+# Useful for testing scenarios where disk space is limited and you
+# want to reclaim disk space as quickly as possible.
+# These values are tuned for testing and are not optimal for production use.
+
+bookkeeper:
+  configData:
+    # roll the journal file more frequently
+    journalMaxSizeMB: "256"
+    # don't keep any journal backups, since we want to clean up disk space as fast as possible
+    journalMaxBackups: "0" # default 5
+    # configure the entry log size limit
+    logSizeLimit: "536870912" # 512MB, default 1073741824 (1024MB)
+    # configure the data compaction (bookie entry log compaction and gc) settings
+    # https://bookkeeper.apache.org/docs/reference/config#garbage-collection-settings
+    # https://bookkeeper.apache.org/docs/reference/config#entry-log-compaction-settings
+    minorCompactionThreshold: "0.2" # default 0.2 (use default)
+    minorCompactionInterval: "300" # default 3600 seconds (5 minutes vs default 1 hour)
+    majorCompactionThreshold: "0.8" # default 0.8 (use default)
+    majorCompactionInterval: "900" # default 86400 seconds (15 minutes vs default 1 day)
+    gcWaitTime: "60000" # default 600000 milli-seconds (1 minute vs default 10 minutes)
+    isForceGCAllowWhenNoSpace: "true" # default false
+    # disk utilization configuration
+    # https://bookkeeper.apache.org/docs/reference/config#disk-utilization
+    # Make sure that diskUsageLwmThreshold <= diskUsageWarnThreshold <= diskUsageThreshold
+    diskUsageLwmThreshold: "0.85" # default 0.95 (inherits diskUsageThreshold); GC keeps running until usage drops below this
+    diskUsageWarnThreshold: "0.9" # default 0.90 (use default)
+    diskUsageThreshold: "0.95" # default 0.95 (use default); bookie goes read-only above this
+    diskCheckInterval: "5000" # value is in milliseconds; check every 5s vs default 10s (10000)
+
+broker:
+  configData:
+    # more aggressive disk cleanup
+    managedLedgerMinLedgerRolloverTimeMinutes: "1"
+    managedLedgerMaxLedgerRolloverTimeMinutes: "5"
+    managedLedgerMaxSizePerLedgerMbytes: "256"
+    managedLedgerCursorRolloverTimeInSeconds: "900"
+    # inactive topic deletion is already enabled by default
+    # (brokerDeleteInactiveTopicsEnabled=true, mode delete_when_no_subscriptions, checked every 60s).
+    # Uncomment to set how long a topic may stay inactive before deletion;
+    # use a SMALL value for faster cleanup (default falls back to brokerDeleteInactiveTopicsFrequencySeconds=60).
+    # brokerDeleteInactiveTopicsMaxInactiveDurationSeconds: "60"
\ No newline at end of file