KP
09/12/2025, 6:49 PMRunLLM
09/12/2025, 6:49 PMKP
09/12/2025, 6:51 PMRunLLM
09/12/2025, 6:51 PMKP
09/12/2025, 6:58 PMproducer, err := p.producers.FailableGetOrSet(topic, func() (pulsar.Producer, error) {
producer, err := p.nativeClient.CreateProducer(pulsar.ProducerOptions{
// general
Topic: topic,
DisableBlockIfQueueFull: true, // drop if queue is full
// batching
DisableBatching: false,
BatchingMaxPublishDelay: 1 * time.Second / 30, // nothing should be publishing faster than 30Hz
BatchingMaxMessages: 800,
BatcherBuilderType: pulsar.KeyBasedBatchBuilder, // note(kp): this is required for key-shared subscriptions
// MaxPendingMessages defaults to 1000 so we explicitly set it here. It should be
// something like 5% of expected traffic, which 1000 is well above.
MaxPendingMessages: 1000,
// compression
CompressionType: pulsar.ZSTD,
CompressionLevel: pulsar.Faster,
})
if err != nil {
return nil, fmt.Errorf("failed to create producer for topic %s: %w", topic, err)
}
return producer, err
})
this is our producer configRunLLM
09/12/2025, 6:58 PMBatcherBuilderType: pulsar.KeyBasedBatchBuilder), batching enabled, ZSTD compression, and MaxPendingMessages: 1000. With only 60 keys, this config should not cause memory usage to spike to 15GB. The default BatchingMaxMessages (800) and BatchingMaxPublishDelay (about 33ms) are reasonable, and DisableBlockIfQueueFull: true means messages are dropped if the queue is full, not buffered indefinitely (producer.go).
Such a large memory increase is not expected from these settings. This suggests a possible bug, resource leak, or an issue elsewhere in the application. No known Pulsar Go client configuration with these parameters should cause this scale of memory growth (producer_impl.go).
Would you like more detail on how to profile or debug this, or on specific areas to investigate?
Sources:
- producer.go
- producer_impl.go 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.Alvaro Rodriguez
09/17/2025, 8:44 AMCGO_ENABLED=1 for performance testing?