Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

We've just upgraded our existing MySQL5.1 DB servers to newer (much better) hardware with MySQL 5.5, and things have been going mostly smoothly for almost 6 weeks.

Just the last few days, I've noticed a few errors, such as:

From a MySQL Slave:

[ERROR] Error reading packet from server: Lost connection to MySQL server during query ( server_errno=2013)

Or From Apache/Other:

Lost connection to MySQL server at 'reading initial communication packet', system error: 110

At one point this evening, many webnodes reported this error for a three minute period (many such reports as this was in a busy period). However, the issues don't appear to correspond with any times of extreme load. For all intents and purposes, the connection/thread load on MySQL is at a normal rate (between about 10 and 40 connected threads), and Web load has been a LOT higher at times over the last few weeks.

Could there bee other reasons for these connection errors, that I'm not seeing?

share|improve this question
    
sysctl -a, networking tuning, timeout settings, keepalives, buffer size. I hope, it's not a Broadcom NIC ^_^ –  GioMac Jun 27 '13 at 22:10

3 Answers 3

Hooray, tuning the max_allowed_packet variable, increasing its value and restart MySQL. It will provide major capacity for MySQL in reading packets. Try it out and give us a feedback.

share|improve this answer
    
Hi Wagner, I tried this about a week ago, and it seems to have partly alleviated the problem, but not completely. I've been looking into client timeouts on our webnodes too, but mostly just experimentation at the moment! –  kwiksand Jun 21 '11 at 19:30
    
Was it set on master and slave ? –  thinice Dec 18 '12 at 3:29

error 110 is "Connection timed out", which suggests that something is happening to the network between your client and MySQL server. Aside from network issues, you could also see this if the server is far too overloaded to respond to the incoming connection.

share|improve this answer

you can try upping wait-timeout or connect-timeout, but this may be masking the root issue. you may have a bad query making mysql processes stack up. check (or enable) your sql slow log. run mysqltuner to possible adjust variables. read the tuning mysql section of mysql docs, and make sure your directives are sane.

EDIT: on the application layer, ie php, you can have the php script die if it does not finish within a period of time, by adjusting the max_execution_time directive

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.