Intermittent Can't connect to MySQL server via private LAN
We have two Linodes linked via a private LAN. One is Apache web server, the other MySQL database.
Database VPS is serving around 100-130 queries per second. The CPU load for both VPSs is rather low.
Yet recently web server is unable to connect to MySQL and reporting:
Can't connect to MySQL server on 'PrivateIP' (4)
(4) is OS error "Interrupted system call"
This happens for around 10 seconds twice each hour and affects 5-10 MySQL client connections only.
Has anyone maybe experience similar issue? Any suggestions how to troubleshoot / fix it?
Kind regards,
Chris
11 Replies
I am running standard Ubuntu 8.04 2.6.24-24 Xen kernel:
$ uname -a
Linux us1 2.6.24-24-xen #1 SMP Fri Sep 18 18:14:17 UTC 2009 x86_64 GNU/Linux
Just did a flood ping test between Linodes and got strange results:
ping -f 192.168.162.72
PING mysql-rw (192.168.162.72) 56(84) bytes of data.
…Warning: time of day goes back (-1098us), taking countermeasures.
Warning: time of day goes back (-1041us), taking countermeasures.
..Warning: time of day goes back (-1043us), taking countermeasures.
..Warning: time of day goes back (-1003us), taking countermeasures.
.
--- mysql-rw ping statistics ---
693417 packets transmitted, 693413 received, 0% packet loss, time 181824ms
rtt min/avg/max/mdev = 0.000/0.216/9.079/0.112 ms, ipg/ewma 0.262/0.217 ms
Never seen "Warning: time of day goes back (-XXXus), taking countermeasures." before… any idea what that might be?
Also note: there is a bit of packet loss - 4 packets out of 693417 seems not much, but this would be roughly the percentage of broken MySQL connections we are seeing.
Regarding the time errors… are you running ntp on both nodes?
15 */2 * * * root /usr/sbin/ntpdate 0.pool.ntp.org > /dev/null
so clocks should be in sync.
ntpd will gracefully adjust your time, ntpdate just smacks it to the current time, which might be in the past, which can really muck things up.
Bottom line… never use ntpdate in a cron job, always run ntpd.
here
@level7:
hmmm… the thing is we are running this set up for the last 30 days, and "Can't connect to MySQL server on '192.168.162.72' (4)" errors started showing up only in the last two days. Please see a log file
here
I'm not promising the time issue is related to the MySQL issue, but it's an easy fix, and bad time can cause very unpredictable errors.
Wait until the times sync then see if the error goes away.
Also have you changed any firewall settings lately?