Currently running an image blog site that spikes in traffic at certain times in the evening. The moment it hits about 400-500 active users on the site, the server cant handle it. Ive moved from server to server, currently running on Intel core 2 duo 2.16 with 2 gigs of ram (godaddy hosting).
Its almost certainly an issue of CPU, as thats what overloads everytime the traffic spikes.
Needless to say, this is impeding on the sites growth. Is there anything out there that can solve this problem?
no, it's actually quite unlikely to be the cpu. here's what happens:
1. when things are running fine, your http server (most likely apache) processes a request quickly and the pool of processes or threads (depending on your chosen processing model) stays relatively stable.
2. then you get a spike in traffic and bottleneck on, say, mysql or the disk.
3. now each apache thread/process takes too long to process each request, so when new requests come in, it forks another process/thread. this is slow and can be expensive, hence the cpu load.
there's a whole lot of other things that can be happening, mind you, with an arbitrary nesting level of brainfuck. for example, extra ram for these new apache processes could be causing mysql indices and even whole tables to now be read from disk rather than from the page cache, which would slow mysql queries down catastrophically, causing even more apache thrashing etc.
it's impossible to diagnose this without knowing a lot of things about both the site and the workload.
here's a list of things you can throw at the problem without diagnosing it (although i would suggest diagnosing it first in the strongest possible terms) in no particular order (assuming php+mysql+wp):
hardware:
* add more ram
* faster hdds with more spindles
* enable php bytecode caching (eaccelerator, apc etc)
* enable output caching (eg total-cache, wp-cache etc)
* stick a caching proxy in front of your httpd (squid, varnish (with pagemem locking) or even better zeus if you've got 15k

)
* optimize mysql
* mysql on a separate spindle-set from images
* images in a nested dir structure (if on ext3) or on reiserfs
* serve images with nginx
* move the whole thing to nginx
the list is endless really and my breakfast's getting cold
pm me with your im handles and i'll be happy to take a quick look
-p