Dec. 10th, 2008

ibneko: (Default)
If your phpBB2 forum is running really slow, and mysql's "show processlist;" shows a lot of queries that look like:
SELECT m.word_id
  FROM phpbb_search_wordmatch m, phpbb_search_wordlist w
  WHERE w.word_text..


That may be the remove_common function in includes/functions_search.php, which, as far as I can tell, removes common keywords. Or something like that.

Credit for finding this goes to http://vladimir-shapiro.com/en/blog/2007/12/07/performance-killer-in-phpbb/

I decided it's probably there for some sort of good reason, so I instead of just putting a "return;" at the top of that function, I did a "if (rand(0,1000) != 0) {return;}", which essentially means that once out of every 1000 times that function is called, it'll run through the function and do whatever it does.

This cut my server load average from 25 down to 0.5.

Expand Cut Tags

No cut tags

Profile

ibneko: (Default)
ibneko

Most Popular Tags

Style Credit

Page generated Jun. 15th, 2025 11:15 am
Powered by Dreamwidth Studios
January 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 2021