-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
High concurrency usage #20
Comments
Hi Andre, what version/branch is this? 0.7 or 0.8/master? |
How many rd_kafka_t objects are you creating, with how many topics, and how many brokers are available in the cluster? |
Hi Magnus, I'm using version 0.8/master. rd_kafka_t *rk = rd_kafka_new(RD_KAFKA_PRODUCER, &conf, than send the msg and wait: rd_kafka_topic_t *rkt = rd_kafka_topic_new(rk, topic, &topic_conf); rd_kafka_produce(rkt, partition, rd_kafka_poll(rk, 0); and finally: rd_kafka_destroy(rk); Thanks! |
Thanks for clarifying your setup. My guess is that the broker threads created by rdkafka arent properly terminated on rd_kafka_destroy() and that is clearly a bug that I will look into. If possible I suggest that you try to hang on to the rd_kafka_t object and reuse it in subsequent rd_kafka_produce() calls to amortize the startup cost of connecting to the broker(s) and fetching metadata for each produced message. Not only will it avoid the above bug but it will provide a far more performant and resource frugal setup. |
I'm working on a fix, should be available end of this week. |
Andre, could you please pull the latest master and give it another go? |
Hi, the problem is gone with the fix. thanks! |
Hi,
I'm writing a nginx module, which parses a message and send it to kafka using librdkafka. But under high level of concurrency, the api locks e and says it cannot create more threads to send the message. Is there a way to overcome this, by using it in a synchronous way, for example?
thanks in advance,
andre
The text was updated successfully, but these errors were encountered: