Good Day I have started getting "could not connect to sql server" from my websites. If i restart sql, then it works again, sometimes for a day, sometimes only for an hour. I have a multiserver setup on Debian 6, I've just updated to Ispconfig 3.0.4.6. I am also getting these entries in my DB server when in debug mode. 2012-10-16 17:35 Warning DB::query(INSERT INTO monitor_data (server_id, type, created, data, state) VALUES (3, 'os_info', UNIX_TIMESTAMP(), 'a:2:{s:4:"name";s:6:"Debian";s:7:"version";s:11:"Squeeze/Sid";}', 'no_state')) -> mysql_query Duplicate entry '3-os_info-1350408928' for key 'PRIMARY' 2012-10-16 17:35 Warning DB::query(INSERT INTO monitor_data (server_id, type, created, data, state) VALUES (3, 'server_load', UNIX_TIMESTAMP(), 'a:8:{s:7:"up_days";d:4;s:8:"up_hours";d:9;s:10:"up_minutes";d:33;s:6:"uptime";s:70:" 19:35:24 up 4 days, 9:33, 1 user, load average: 10.05, 7.98, 4.44n";s:11:"user_online";i:1;s:6:"load_1";d:10.050000000000000710542735760100185871124267578125;s:6:"load_5";d:7.980000000000000426325641456060111522674560546875;s:7:"load_15";d:4.44000000000000039079850466805510222911834716796875;}', 'ok')) -> mysql_query Duplicate entry '3-server_load-1350408927' for key 'PRIMARY' 2012-10-16 17:35 Warning DB::query(INSERT INTO monitor_data (server_id, type, created, data, state) VALUES (3, 'ispc_info', UNIX_TIMESTAMP(), 'a:2:{s:4:"name";s:9:"ISPConfig";s:7:"version";s:7:"3.0.4.4";}', 'no_state')) -> mysql_query Duplicate entry '3-ispc_info-1350408927' for key 'PRIMARY' 2012-10-16 17:35 Warning DB::query(INSERT INTO monitor_data (server_id, type, created, data, state) VALUES (3, 'ispc_info', UNIX_TIMESTAMP(), 'a:2:{s:4:"name";s:9:"ISPConfig";s:7:"version";s:7:"3.0.4.4";}', 'no_state')) -> mysql_query Duplicate entry '3-ispc_info-1350408927' for key 'PRIMARY' 2012-10-16 17:35 Warning DB::query(INSERT INTO monitor_data (server_id, type, created, data, state) VALUES (3, 'os_info', UNIX_TIMESTAMP(), 'a:2:{s:4:"name";s:6:"Debian";s:7:"version";s:11:"Squeeze/Sid";}', 'no_state')) -> mysql_query Duplicate entry '3-os_info-1350408927' for key 'PRIMARY' 2012-10-16 17:35 Warning DB::query(INSERT INTO monitor_data (server_id, type, created, data, state) VALUES (3, 'os_info', UNIX_TIMESTAMP(), 'a:2:{s:4:"name";s:6:"Debian";s:7:"version";s:11:"Squeeze/Sid";}', 'no_state')) -> mysql_query Duplicate entry '3-os_info-1350408927' for key 'PRIMARY' 2012-10-16 17:35 Warning DB::query(INSERT INTO monitor_data (server_id, type, created, data, state) VALUES (3, 'server_load', UNIX_TIMESTAMP(), 'a:8:{s:7:"up_days";d:4;s:8:"up_hours";d:9;s:10:"up_minutes";d:33;s:6:"uptime";s:70:" 19:35:24 up 4 days, 9:33, 1 user, load average: 10.05, 7.98, 4.44n";s:11:"user_online";i:1;s:6:"load_1";d:10.050000000000000710542735760100185871124267578125;s:6:"load_5";d:7.980000000000000426325641456060111522674560546875;s:7:"load_15";d:4.44000000000000039079850466805510222911834716796875;}', 'ok')) -> mysql_query Duplicate entry '3-server_load-1350408926' for key 'PRIMARY' 2012-10-16 17:35 Warning DB::query(INSERT INTO monitor_data (server_id, type, created, data, state) VALUES (3, 'server_load', UNIX_TIMESTAMP(), 'a:8:{s:7:"up_days";d:4;s:8:"up_hours";d:9;s:10:"up_minutes";d:33;s:6:"uptime";s:70:" 19:35:25 up 4 days, 9:33, 1 user, load average: 10.05, 7.98, 4.44n";s:11:"user_online";i:1;s:6:"load_1";d:10.050000000000000710542735760100185871124267578125;s:6:"load_5";d:7.980000000000000426325641456060111522674560546875;s:7:"load_15";d:4.44000000000000039079850466805510222911834716796875;}', 'ok')) -> mysql_query Duplicate entry '3-server_load-1350408926' for key 'PRIMARY' Any assistance would be greatly appreciated as I have been trying to sort this problem out for nearly a week now.
Thanks so much for your response. I think so, it's got 4GB, it's not a very busy server, how much ram do you think I need and how do I optimize MySQL?
Try to set max_connections = 500 max_user_connctions = 500 in the [mysqld] section of the mysql my.cnf file and restart mysql.
I have made the changes, will see how it goes and will let you know if it happens again. Thanks again for your assistance, really appreciate it.