-
Notifications
You must be signed in to change notification settings - Fork 49
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
Connection Pool #233
Comments
hey Scott, I haven't implemented any connection pool feature. The gem you are referring to has an assumption: "There is no provision for repairing or checking the health of a connection; connections should be self-repairing. This is true of the Dalli and Redis clients." This is not so true with NoBrainer. Upon failure, NoBrainer issues a disconnect (https://github.com/nviennot/nobrainer/blob/master/lib/no_brainer/query_runner/reconnect.rb#L5) and a new connection is instantiated on the next try (https://github.com/nviennot/nobrainer/blob/master/lib/no_brainer/connection_manager.rb#L60) My advice is to implement our own pool instead of relying on an external gem, but feel free to implement it however you see fit. I'm available for questions. |
That is basically exactly how we have implemented connection_pool. If the driver raises one of the errors in |
Just an update on this. We put our basic implementation into production about 2 weeks ago, and it's been working very well for us. We have had very few connection issues since then. I will try and put together a PR when i get time. |
@scottrobertson cool! 👍 |
@scottrobertson Would you be willing to post the code you are using? I'm interested in doing the same thing, and a head start would be great :). |
@meenie hey. This is basically what we are doing: And the There will be a cleaner way to do this, but it works well for us even though it's hacky :) |
Awesome, thanks for the fast response! |
Sorry for coming so late on this one, but I'd like to know if you have any code to implement this feature in this gem? |
We stopped using Rethink a long time ago, so I don’t have anything sorry. |
Thank you for your quick answer 🙏 |
Well, the connection pool is still a thing this gem should have, I would have kept this issue open. Could you please tell why you've closed this issue ? |
@scottrobertson any input please? |
@zedtux feel free to reopen it if you want. I've not used this in a long time and I just closed all my stale/inactive issues in bulk. |
Thank you for your feedback. |
Hey @nviennot
We are at the point that we could really do with a connection pool (we are hitting timeout issues at the moment, and are trying to reduce the load on the DB), so it's something I could work on implementing into NoBrainer. But first of all, I was just wondering, have you ever started work on implementing it into NoBrainer? If so, where did you land on it?
We have one in place using https://github.com/mperham/connection_pool for our none NoBrainer queries and it's been working super well for us in production.
The text was updated successfully, but these errors were encountered: