Question

I knew this error occurs when server restart or bandwidth issue. But we have unlimited bandwidth and server is not going restart. I'm unable to trace why I'm getting this error.

This error occurs only when i run cron job on the server. I've set cron job for every 10 min to perform few calculations and update tables.

protocol_version : 10
version : 5.1.65-cll
version_comment : MySQL Community Server (GPL)
version_compile_machine : x86_64
version_compile_os : unknown-linux-gnu

Please help.

Était-ce utile?

La solution 3

Actual issue was with my count of queries executing. About 50000 queries were executing for every 10 min so server was going away. I've reduced the limit and time interval, it is working fine now.

Thanks for your answers, it also helped me a lot.

Autres conseils

I've run into a similar situation cron job that took a while to run (ran nightly, updating reporting tables). The fix was to increase the mysql.connect_timeout and default_socket_timeout in the my.conf file. Alternately, you could use ini_set to set these values at the script level if you cannot/do not want to change it server-wide.

Also see this SO post as it deals with exactly the same thing:

https://stackoverflow.com/a/1644572/1867941

To prevent these kinds of problem, you should create a presistent connection and check if the connection exists(and reconnect) before running each query.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top