MySQL Forums
Forum List  »  PHP

Re: MySQL Timeout
Posted by: Rick James
Date: March 04, 2010 10:30PM

What is connecting to MySQL? A web server? Such as Apache? If so, lower MaxClients to 20. That may be the complete solution.

Are queries taking a long time? Optimizing the queries could be the real solution.

"Connect timeout" -- If you can't connect in 2 seconds, there are network problems and there is no use waiting any longer.

If it is a web application, 60 seconds is enough for the user to go away and never come back. 10 seconds might be tolerated.

After you connect, execute "SET wait_timeout = 20".

Yeah, I'm guessing in multiple directions. To get a better handle on what is going on, please try to do this: SHOW PROCESSLIST. I want to know how many rows there are, how many say "Sleep", the range of values for the "Sleep" rows, and what queries (SELECT, etc) are running and for how long (Time). From one such snapshot, I might be able to make a more correct assessment about wait_timeout, slow queries, etc.

Options: ReplyQuote


Subject
Written By
Posted
March 03, 2010 05:35AM
Re: MySQL Timeout
March 04, 2010 10:30PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.