We recently started having intermittent errors connecting to the database, and I can't figure out why. This started after some maintenance on the SAN backing our VMware environment, but I don't have any other evidence that the two events are related. Both the Moodle server and the MySQL server are VMs in that environment. This is what I've found in the logs so far:
[Thu Jan 02 01:58:08 2014] [error] PHP Warning: mysqli::mysqli(): (HY000/2003): Can't connect to MySQL server on 'x.x.x.x' (110) in /var/www/moodle/lib/dml/mysqli_native_moodle_database.php on line 296
[Thu Jan 02 01:58:08 2014] [error] PHP Warning: mysqli::close(): Couldn't fetch mysqli in /var/www/moodle/lib/dml/mysqli_native_moodle_database.php on line 336
All of my Googling on that error has turned up results with firewalls and other immediately post-installation issues, but this works generally, and only fails on some queries, so I'm not sure. It seems like maybe it's some kind of resource limit on the MySQL side or a really terrible slow query, but I haven't found anything yet. Any pointers?
Moodle release: 2.1.1+ (Build: 20110907)