The new EricMartindale.com is an experiment in data aggregation, and might have a few bugs. Feel free to explore, and then provide feedback directly to @martindale.

search results for apache

Tuning Large phpBB3 Forums

One of the sites I own and run (RolePlayGateway) has a pretty large forum, with several customizations and features that I've added on to the base install of phpBB3. As time went on, we continued upgrading the servers (moving from GoDaddy shared hosting to GoDaddy virtual dedicated servers, then onward to MediaTemple's (gs), and now we're on the second tier of MediaTemple's (dv) hosting) in an effort to keep the hardware moving as fast as possible.

As I'm sure you know, hardware can be pretty expensive! One month, while on MediaTemple's Grid Server, we racked up $600 in CPU time overage charges. (Ow.) Now that we've moved onward to bigger and better packages, we're shelling out just about $100 per month for a rock-solid server solution that can be upgraded seamlessly in the future. But since upgrades can only go so far without being prohibitively expensive, I thought it was time to take a look at some of our coding approaches.

Enter memcache, the distributed database caching solution originally designed by LiveJournal to help them deal with massive databases and large volumes of users. DavidMJ has written some shiny ACM modules to help phpBB3 make use of some caching systems, and a memcache module was among them.

That didn't work so well. It gave about a 50% boost to phpBB3's performance (which was great!), but we were still choking the server, and ended up upgrading to a bigger and more robust package with MediaTemple. So I started looking into more options, and DavidMJ suggested xcache. So I go grab xcache and compile it, then enabled it in php. Bingo! There's a 500% boost in our page compile times, and across most of our pages we're now well under 0.1 second compile times. (With the exception of viewtopic.php, which frequently approaches 2 seconds due to bad coding on my part... this will be fixed soon.)

So now that I've got the thirst for speed, let's take a look at how we're performing. To do this, use the apache benchmarking tool:ab -n 100000 http://www.mydomain.com/my_page This will test the URL you specify 100,000 times, and give you some feedback about how the page performs. You'll end up with something looking like this:

Server Software: Apache/2.2.3 Server Hostname: www.mydomain.com Server Port: 80 Document Path: /my_page Document Length: 0 bytes Concurrency Level: 1 Time taken for tests: 15.30100 seconds Complete requests: 1 Failed requests: 0 Write errors: 0 Non-2xx responses: 1 Total transferred: 715 bytes HTML transferred: 0 bytes Requests per second: 0.07 [#/sec] (mean) Time per request: 15030.100 [ms] (mean) Time per request: 15030.100 [ms] (mean, across all concurrent requests) Transfer rate: 0.00 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 0.0 0 0 Processing: 15030 15030 0.0 15030 15030 Waiting: 30 30 0.0 30 30 Total: 15030 15030 0.0 15030 15030

Some tweaks to the default xcache config that I recommend:

Set the number of caches to one per processor on your server! ; set to cpu count (cat /proc/cpuinfo |grep -c processor) xcache.count = 4

This post will be updated as I explore phpBB3 and more server side options. (I wrote part of this post, then stopped writing... and figure I'd publish it a couple days later anyway!)

0 Replies

Replies are automatically detected from social media, including Twitter, Facebook, and Google+. To add a comment, include a direct link to this post in your message and it'll show up here within a few minutes.