Suggestions for Tweaking Performance for Spikes in Visitor Numbers

I have several questions as a new user of XenForo that may also be of use to other newbies just starting out.

I have a rather fresh install of XenForo (came over from vbulletin and also recently switched hosts). The forum has 350,000+ posts.

The forum typically has
  • about 25 to 50 people on the forum during regular hours (members + visitors)
  • sometimes spikes to 200 forum users if one of the blog articles or a forum post is linked to on a popular website.
  • can be 500 forum users once a year or so when Digg or Reddit etc links to the site.
  • there is also a blog that can pull in substantial readership
Usually the site works very well, but during spikes in visitor nubmers it slows to a crawl and may even go offline when the total forum users only reaches 150 people.

I visited the Defining a Cache page:

Not being very savvy on these things, is it correct that all I need to do for this is to add the following to config.php:

$config['cache']['enabled'] = true;
$config['cache']['frontend'] = 'Core';
$config['cache']['frontendOptions']['cache_id_prefix'] = 'xf_';
That's it?

What other tweaks for the server, php, mysql etc might work well without much knowledge other than CPANEL and WHM basics as well as contacting the host?

The website is on a VPS with HostGator "Level 4"
  • CPU 1.98 GHZ
  • RAM 1344 MB
Would there be much to gain if I went with, say, a "Level 6" (cost is not much of an issue)
  • CPU 3.4 GHZ
  • RAM 2304 MB
or are there more important bottlenecks that can be "fixed" to help the site stay up and running during times of high visitor numbers?

Thanks in advance

Chris D

XenForo developer
Staff member
We have occasional spikes too. We hit 2000 concurrent users a few weeks ago when being linked to from Reddit.

Only yesterday we implemented simple file based caching and here's a quote from our server monkey:

StarMonkey: apache accesses are about normal
StarMonkey: disk latency is up quite a lot
StarMonkey: mysql usage is down by a massive amount (70-75%)
StarMonkey: mysql throughput is also miles down
StarMonkey: as is the query cache]
StarMonkey: network traffic is down quite a lot
StarMonkey: cpu usage is about the same, probably because of the iowait with the cache being on disk
StarMonkey: load average is also about the same
So it looks like that'd be a huge benefit to you. If you implemented an opcode cache such as APC or memcache then this would likely be even better!
If you implement something like APC then you can also store templates as files which will even further cut down on database queries. I'd say that definitely increasing up to a higher processor speed and RAM would always be a huge benefit, but possibly only during those times where it is busy so potentially quite wasteful.
There are hosts out there ( possibly one of them?) who can dynamically allocate resources or do so on demand during busy periods so that could be one area to look at too.


Well-known member
You do have to make sure the resources you have are properly allocated. That is, apache and mysql. If either has too much of the RAM or processes, it will screw things up. Others may be more qualified to say exactly how to allocate (settings in apache and mysql), but limits should be put on various things like the number of servers apache spawns and the caches that mysql builds for itself. (cnf file).

I don't fully understand how they allocate their CPU's - that is, if this is one core you are dealing with. If so, that in itself may be a bottleneck. Again, I'm no expert but the quad core server chip rock! I had an older 3.0 dual core and was hitting a wall on my old forum with about 600 total people online (members and guests combined).

You can probably suss out some of this if you have access to a shell account and can monitor your server while things are happening. You can also run report on mysql (phpmyadmin has a default report in it) which suggest settings and bottlenecks.


Well-known member
What other tweaks for the server, php, mysql etc might work well without much knowledge other than CPANEL and WHM basics as well as contacting the host?
download from grab whm centos version and run it on your server via ssh, should grab all your relevant server stats for diagnostic purposes. You can also run it as a cron job for hourly logging of server stats as well to catch those peak/slow times as well.