[Backgroundrb-devel] Mysql too many connections

Ben Johnson 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.

Thank You,
Ben Johnson
E: bjohnson at contuitive.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20060801/2e04af4a/attachment.html 

More information about the Backgroundrb-devel mailing list