broker.conf or standalone.conf configuration files. This guide covers the most important configuration parameters for production deployments.
General Broker Settings
Core settings that define how the broker operates and communicates.The metadata store URL for ZooKeeper or other metadata services.Examples:
zk:my-zk-1:2181,my-zk-2:2181,my-zk-3:2181zk:my-zk-1:2181,my-zk-2:2181,my-zk-3:2181/my-chroot-path
Name of the cluster to which this broker belongs. This is required for multi-cluster deployments and geo-replication.
Broker data port for Pulsar binary protocol connections.
Port to serve HTTP requests, including the admin API.
Broker data port for TLS connections. TLS is disabled by default.
Port to serve HTTPS requests. TLS is disabled by default.
Network Configuration
Hostname or IP address the service binds on.
Hostname or IP address the service advertises to the outside world. If not set, uses the canonical hostname.
Multiple advertised listeners for the broker in the format:
<listener_name>:pulsar://<host>:<port>Multiple listeners should be separated with commas. Do not use with advertisedAddress and brokerServicePort.Thread Pool Configuration
Number of threads to use for Netty IO.Default:
2 * Runtime.getRuntime().availableProcessors()Number of threads for the ordered executor, used for ZooKeeper operations, namespace policies, and bundle splitting.
Number of threads for HTTP request processing.Default:
2 * Runtime.getRuntime().availableProcessors()Thread pool size for broker operations like load/unload bundles and leader election.Default:
Runtime.getRuntime().availableProcessors()Topic and Namespace Management
Enable topic auto-creation when new producers or consumers connect.
Type of topic allowed for auto-creation.Options:
partitioned | non-partitionedNumber of partitions for auto-created partitioned topics.
Enable subscription auto-creation when new consumers connect.
Enable deletion of inactive topics. Should be used with
allowAutoTopicCreation.How often to check for inactive topics (in seconds).
Mode for deleting inactive topics.Options:
delete_when_no_subscriptions- Delete topics with no subscriptions and no active producersdelete_when_subscriptions_caught_up- Delete topics where all subscriptions are caught up
Message Handling
Maximum size of messages in bytes (5 MB default).
How frequently to check and purge expired messages.
Maximum unacknowledged messages allowed for a consumer on a shared subscription. When reached, the broker stops sending messages until the consumer acknowledges.Set to
0 to disable the limit.Maximum unacknowledged messages allowed per shared subscription.Set to
0 to disable the limit.Backlog Quotas
Enable backlog quota checks and enforcement.
How often to check for topics that have reached quota limits.
Default per-topic backlog quota limit in bytes.
-1 means no limitation.Default backlog quota retention policy.Options:
producer_request_hold- Hold producer send requests until resources are availableproducer_exception- Throw exception to the producerconsumer_backlog_eviction- Evict oldest messages from slowest consumer
Metadata Store Settings
Metadata store session timeout in milliseconds.
Metadata store operation timeout in seconds.
Enable metadata operations batching for better performance.
Maximum delay for batching grouping in milliseconds.
BookKeeper Client Configuration
Timeout for BookKeeper add/read operations.
Enable bookies health checks. Bookies with too many failures are quarantined.
Enable rack-aware bookie selection. BookKeeper chooses bookies from different racks when forming ensembles.
Managed Ledger Configuration
Number of bookies to use when creating a ledger (standalone default).
Number of copies to store for each message (standalone default).
Number of guaranteed copies (acks to wait before write is complete).
Maximum entries to append to a ledger before triggering a rollover.
Minimum time between ledger rollovers for a topic.
Maximum time before forcing a ledger rollover for a topic.
Performance Tuning
Maximum number of entries to read from BookKeeper per batch.
Maximum size in bytes of entries to read from BookKeeper (5 MB default).
Default message dispatch throttling limit per topic.
0 disables throttling.Default byte dispatch throttling limit per topic.
0 disables throttling.Configuration Files
Pulsar provides two main configuration files:conf/broker.conf- Configuration for production broker deploymentsconf/standalone.conf- Configuration for standalone (single-node) deployments
- Edit the configuration file
- Restart the broker service
Environment Variables
Many configuration parameters can be overridden using environment variables with thePULSAR_PREFIX_ prefix: