-
Notifications
You must be signed in to change notification settings - Fork 909
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
AMPQ broker connection reusing #26
Comments
@requilence Hi Roman. There is no specific reason for it. You can submit a PR if you want. I'm a bit busy at the moment but performance improvements like this are needed. The way I did it was the easiest implementation but it would be much better to reuse connections. |
@RichardKnop Ok, I will test my solution and if everything works great I will create PR. |
@requilence |
I've working on some go-amqp stuff (another worker queue project) and found this (issue)[https://github.com/streadway/amqp/issues/119] in that project. Quote from one discussant:
In current implementation of machinery, we create a channel (and connection) per 'SendTask', it seems a reasonable implementation, or maybe we would at least maintain a 'channel pool' for each request from different go routine. |
@mission-liao Also the similar approach is using in https://github.com/go-mgo/mgo. |
Great work and investigation guys. It seems reusing channels might be the way to go. |
Is there a reason to open/close broker connection on every message publishing?
In a single goroutine with AMPQ connection reusing I have 110 msg publish/sec vs 55 msg/sec with current implementation.
Also with using of goroutines to publish messages I was able to get 34000 msg/sec on the same configuration. Looks like goroutines is safe when reusing AMPQ connection
The text was updated successfully, but these errors were encountered: