Skip to content
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

Recycle MySQL connections every 5 minutes #2

Closed
wants to merge 1 commit into from

Conversation

yuvipanda
Copy link
Contributor

MySQL will consider all connections that have been idle for a specific time
period to be 'stale' and close them. We work around this by telling
SQLAlchemy to recycle old connections (disconnect/reconnect) after 5
minutes of having started them. MySQL connections are cheapish enough
that this works ok.

MySQL will consider all connections that have been idle for a specific time
period to be 'stale' and close them. We work around this by telling
SQLAlchemy to recycle old connections (disconnect/reconnect) after 5
minutes of having started them. MySQL connections are cheapish enough
that this works ok.
@mahmoud
Copy link
Member

mahmoud commented Oct 2, 2016

Good point! I actually implemented this on-server while debugging it. I'll bring this in with the other fixes I'm merging back in from that environment. Also, good to know it's 300 seconds (I had put 60).

@yuvipanda
Copy link
Contributor Author

It isn't actually 300, I just made that up :) The actual number is 3600 rn,
but don't entirely depend on that...

On Sun, Oct 2, 2016 at 10:16 PM, Mahmoud Hashemi notifications@github.com
wrote:

Good point! I actually implemented this on-server while debugging it. I'll
bring this in with the other fixes I'm merging back in from that
environment. Also, good to know it's 300 seconds (I had put 60).


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#2 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAB23u2A3DyPa5ZC9L2dP_HS1lUQruw0ks5qwBEdgaJpZM4KMGlw
.

Yuvi Panda T
http://yuvi.in/blog

@mahmoud
Copy link
Member

mahmoud commented Oct 11, 2016

Closing for reasons stated above, but thank you!

@mahmoud mahmoud closed this Oct 11, 2016
@mahmoud mahmoud deleted the fix-db-timeout branch July 5, 2017 06:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants