vmysql: sql error[3]: MySQL server has gone away
Well, I am in the middle of migrating a rather large mail server, using qmail+vpopmail+mysql+courier-imap.
And just when it's starting into production usage, we find the error in the title.
A lot.
Sadly, since that error indicates a failed MySQL query, it means you get stuff like random auth failures. Which sucks a lot.
Googling gave a lot of hints. But nothing would fix it.
Until.... lucky strike.
So, I will put my solution here for future googlers.
If you see this:
vmysql: sql error[3]: MySQL server has gone away vmysql: sql error[3]: MySQL server has gone away vmysql: sql error[3]: MySQL server has gone away vmysql: sql error[3]: MySQL server has gone away vmysql: sql error[3]: MySQL server has gone away
Do the following:
Check if you are exceeding mysql's max_connections parameter. The default is 100.
Check if your cpu can take the load. (No, don't look at the load average. Look at the CPU usage).
Make really sure that vpopmail and courier-authlib are built using the exact mysql you have installed. No, it doesn't matter if it's the same version. Go, and rebuild the things!
That fixed it for me.
On other bizarre news about this server, I have low CPU usage (95% idle), low IO (iostat reports under 1MB/sec, 40 tps), yet I have a load that can go up to 120.
Yet, interactive response is fine.
Weird.
Informative KDE blog.
Hola Roberto, si el server es un Intel, probá desactivando el HyperThreading. Algunas veces tenerlo activado trae problemas raros de este tipo. Saludos!