WordPress Server Load Problem: Cause & Solution

By Angsuman Chakraborty, Gaea News Network
Thursday, August 23, 2007

I was watching the mysql queries using mytop just before our server went down. In a flash I realized the cause of our persistent server load problem. I have also come up with an elegant solution which I will implement in the next few days.

The problem is due to huge spam comment load on my server and the facts that a) MySQL does table locking on insert and b) update statements gets priority over the select statements. So if you have even one “insert into wp_comments” waiting (due to table locking) then all the “select from wp_comments” are forced to wait in queue.

What about the solution?
There are few obvious ways to handle it. The first thing I tried is setting updates to low priority to allow select statements to pass through:
set-variable = low_priority_updates=1
In WordPress updates are much less frequent than reads, so it makes sense to give lower priority to updates and let select pass through.

So far everything looks great. Keep an eye on this article to get updates on my quest.

Discussion

siddu
March 9, 2010: 11:41 pm

2018Blank page

February 2, 2010: 8:15 pm

Thanks code worked.Problem resolved :)

YOUR VIEW POINT
NAME : (REQUIRED)
MAIL : (REQUIRED)
will not be displayed
WEBSITE : (OPTIONAL)
YOUR
COMMENT :