[Backgroundrb-devel] Mysql too many connections
bjohnson at contuitive.com
Tue Aug 1 23:44:29 EDT 2006
I wrote an email to the mailing list about this a couple of days ago.
But I have new info and need some help.
Basically in my background process I am creating new threads. Each
thread get's it's own database connection. The problem is that when
the thread is finished or killed it doesn't close the connection.
What mysql has is a wait_timeout variable. This is set to 8 hours and
max_connections is set to 100. I could easily set max_connections to
500 and wait_timeout to 60 seconds or something. This would solve my
problem, but as well all know this is a hack.
Is there a way to close the db connection when the thread is finished
or killed? To make life easier I even kill and clean up my threads
through my own method. I just need to know how to close a threads
connection from outside of the thread.
Thanks for your help.
E: bjohnson at contuitive.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Backgroundrb-devel