Suhas Karanth
04/10/2025, 7:12 AMRunLLM
04/10/2025, 7:12 AM-Xms (initial heap size) and -Xmx (maximum heap size) options to lower values in the Pulsar configuration. For example, you can set these options in the PULSAR_MEM environment variable or directly in the Pulsar startup script.
2. Configure Memory Limits: If you are running Pulsar in a containerized environment, ensure that the container has sufficient memory allocated. You can adjust the memory limits in your container orchestration tool (e.g., Docker, Kubernetes) to provide more memory to the Pulsar container.
3. Optimize Pulsar Configuration: Review and optimize other Pulsar configurations that might impact memory usage, such as reducing the number of threads or adjusting the message retention settings.
4. Monitor Resource Usage: Use monitoring tools to keep an eye on the memory usage of the Pulsar process. This can help you identify if there are specific patterns or workloads that cause memory spikes.
Would you like more detailed steps on any of these suggestions?
Sources:
- StreamNative Advanced Configuration
- Pulsar Client Libraries 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.Suhas Karanth
04/10/2025, 7:14 AMRunLLM
04/10/2025, 7:14 AMexport PULSAR_MEM="-Xms512m -Xmx1g -XX:MaxDirectMemorySize=1g"
This configuration sets the initial heap size to 512 MB, the maximum heap size to 1 GB, and the maximum direct memory size to 1 GB.
2. PULSAR_EXTRA_OPTS: This variable can be used to pass additional JVM options. For example, you can disable IPv4 stack preference if needed:
export PULSAR_EXTRA_OPTS="-Djava.net.preferIPv4Stack=false"
3. PULSAR_GC: If you need to configure garbage collection settings, you can use this variable. For example, to use the G1 garbage collector:
export PULSAR_GC="-XX:+UseG1GC -XX:MaxGCPauseMillis=200"
These environment variables can be set in your shell or added to the Pulsar startup script to ensure they are applied when Pulsar starts. Would you like more detailed guidance on configuring these variables?
Sources:
- StreamNative Advanced Configuration 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.Suhas Karanth
05/08/2025, 9:44 AMpulsar:
image: "apachepulsar/pulsar:4.0.4"
container_name: "pulsar-res-ct"
hostname: "pulsar-res-ct"
command: "bin/pulsar standalone"
environment:
PULSAR_MEM: "-Xms512m -Xmx512m -XX:MaxDirectMemorySize=256m"
ports:
- "6650:6650"
- "8086:8080"
How do I add healthcheck to this?RunLLM
05/08/2025, 9:44 AMhealthcheck section. For Pulsar, a simple check is to use the built-in healthcheck script. Example:
pulsar:
image: "apachepulsar/pulsar:4.0.4"
container_name: "pulsar-res-ct"
hostname: "pulsar-res-ct"
command: "bin/pulsar standalone"
environment:
PULSAR_MEM: "-Xms512m -Xmx512m -XX:MaxDirectMemorySize=256m"
ports:
- "6650:6650"
- "8086:8080"
healthcheck:
test: ["CMD", "bin/pulsar-admin", "brokers", "healthcheck"]
interval: 30s
timeout: 10s
retries: 3
This uses the pulsar-admin brokers healthcheck command, which is the recommended way to check broker health in Pulsar containers. Would you like more details or troubleshooting tips?
Sources:
- Pulsar Docker Compose Example 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.Suhas Karanth
05/08/2025, 10:24 AMRunLLM
05/08/2025, 10:24 AMbin/pulsar-admin CLI. Example:
docker exec -it pulsar-res-ct bash
bin/pulsar-admin namespaces create my-tenant/my-namespace
bin/pulsar-admin topics create-partitioned-topic my-tenant/my-namespace/my-topic -p 4
This creates a namespace and a partitioned topic with 4 partitions. Would you like more details or examples for non-partitioned topics?
Sources:
- Pulsar Admin CLI Tutorial
- How to create a topic 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.Suhas Karanth
05/08/2025, 10:25 AMRunLLM
05/08/2025, 10:25 AMbin/pulsar-admin CLI:
docker exec -it pulsar-res-ct bash
bin/pulsar-admin tenants create my-tenant
bin/pulsar-admin namespaces create my-tenant/my-namespace
This creates a tenant named my-tenant and a namespace named my-namespace under that tenant. Would you like more details on setting admin roles or allowed clusters?
Sources:
- Pulsar Admin CLI Tutorial
- Create a namespace 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.