2005-10-25 14:48

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:

  1. Check if you are exceeding mysql's max_connections parameter. The default is 100.
  2. Check if your cpu can take the load. (No, don't look at the load average. Look at the CPU usage).
  3. 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.

Comments

Comments powered by Disqus

Contents © 2000-2019 Roberto Alsina