Benjamin Juang (ibneko) wrote,
Benjamin Juang
ibneko

phpBB phpbb_search_wordmatch/phpbb_search_wordlist slow queries

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.
Subscribe

  • ThinkGeek Coupon!

    ThinkGeek: $5 off $25 / $10 off $50+ Code: CCA Expires: 07/10/2008 [edit] Or even better: ThinkGeek: $5 off $25 / $10 off $50+ Code: 8EBB Expires:…

  • Best Buy Coupon

    This could probably get you a free router, or $20 160 GB hard drive :D • Any memory and installation(save $90) • Any all-in-one printerfor your…

  • Random coupon. 10% off at Targets

    Target.com: 10% off iPods, Sony PSP, kitchen, everything else ------------------------------------------------------------- Matched on subscription…

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 1 comment