Skip to content
This repository has been archived by the owner on Jun 10, 2022. It is now read-only.

Huge delay while sending the message from producer #17

Closed
shades198 opened this issue May 8, 2015 · 1 comment
Closed

Huge delay while sending the message from producer #17

shades198 opened this issue May 8, 2015 · 1 comment

Comments

@shades198
Copy link

I was profiling producer code and found that producer->send() was taking more than 30 ms even on localhost! When I dug up a little I found that $this->zookeeper->getPartitionState($topicName, $partitionId); in src/Kafka/Client.php in function name getHostByPartition. This line of code was taking almost all of that time. The application I am working with cannot accept a delay of 5-10 ms more. Is there any workaround for this?

@davidsheldon
Copy link
Contributor

Can you use the new non-Zookeeper producer? Pass the Kafka broker(s) as the last parameter of the constructor, rather than the Zookeeper hosts as the first.

e.g. $this->producer = new Produce(null, null, $kafkaBrokers);

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants