Update 12/12/2010: Now I finally have the clues. It was a plugin’s fault. Now I’m breaking down to debug all the plugins’ queries to the database.
From my previous post 504 Gateway Timeout With Nginx And Apache, I’m still having the same issue. But now I’ve finally broken it down to what exactly causes it. Nginx will produce a 504 gateway timeout error when the Apache response time reaches the nginx proxy timeout. And what causes Apache to respond slowly is the MySQL database slow query and high memory consumption.
I have optimized the Apache and MySQL server, and the server was good for months. But lately I’ve been getting frequent nginx 504 gateway timeout errors. Now I’m moving on to debug slow MySQL queries and see what’s causing it.
On the server I have 6 WordPress blogs with low traffic — a maximum of only 10k unique visitors per day. But as you know, WordPress with bloated plugins is very resource-consuming. And I’m wondering which plugin is causing the whole server to be busy.
