-
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
Sparse connections #284
Comments
A shortcoming of the Kafka protocol is that you can't identify the broker you are connected to, you can only do this by reference. That's why librdkafka can't know that the bootstrap broker is indeed the same as one reported from metadata. Anyway, others have raised concerns about the number of open connections, and I believe the scala/java clients only keeps connections open to the brokers it needs (e.g., the leaders for topic+partitions being produced/consumed). |
Hmm. Can't you just call getpeername() on the socket to know who you're talking to? |
I could, but DNS does not have to be asymetric, nor 1:1, so it couldn't really be trusted. Disconnecting from brokers we dont need will solve your problem though, e.g., sparse connections, so that's what I'll go for. |
Fair enough. I prefer your solution anyway as it further reduced connections |
Hi- do you happen to know when you might implement this? I've made some changes to my code to feed you only one broker at a time (as needed) to reduce connections. If you add the sparse option soon (like within the week), I'll include that in my release. If you think it will be longer I'll just release with my change only (still a 40% improvement in our env) |
Sparse connections will go into the dev branch with a bunch of other changes, so it is most likely a month or so from being merged into master. |
Duplcate of #825 |
Let's say I have 5 broker hosts in the cluster. I'm noticing if I supply a single broker to the API, there will be 6 connections created. 1 to each broker and 1 extra to the broker I supplied the API. I imagine the logic is simple and it is connecting to all the brokers in the metadata list but I think it should ignore the 1 it's already talking to. Can it be enhanced to skip him? We are trying to reduce the number of connections to the brokers.
The text was updated successfully, but these errors were encountered: