Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I currently run a website we get about 15,000-20,000 hits a day. We currently run a very active forum, that is hosted using Vbulletin software. We have 4.5 Million Posts, 80,000 Threads, with about 11,000 members of which just under a third is active all the time. Now I am running a Intel Xeon Quad Core (2.13Ghz) with 4GB of RAM, Centos 5.5 and running DirectAdmin on the box to manage it. I also run the current stable version of Apache, MySQL, and php. This is the only site that is hosted on this machine. Now during random times of day sometimes when it gets busy the server load can get to like 20, but this can also happen when we only have like 200 users active too. I don't understand what is causing these problems. Sometimes I get pages that can generate in .2 seconds other times it takes like 5-8 seconds. I have customized the my.cnf file and that has not helped out anything, I didn't know where else to turn so if anyone has any suggestions please let me know.

share|improve this question

closed as off-topic by HopelessN00b Apr 3 at 17:09

  • This question does not appear to be about server, networking, or related infrastructure administration within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

2 Answers 2

Do you have logging in place:
Sadly many folks often forget looking @ the logs to get a view into their problem.

I would start with some Basic Monitoring, Logging & Diagnostic Toolset.

  1. top
  2. mtop
  3. innotop
  4. MySQL processlist / mysqladmin proc
  5. MySQLTuner
  6. MySQLidxchk: (great for log parsing)
  7. MySQLSLA - status reporting for MySQL:
  8. MySQLReport - http:// (great utility that interprets MySQL’s SHOW STATUS values into a detailed report on how MySQL is running
  9. IOTOP / SAR
  10. Are you sure all the traffic is valid traffic? might want to double check against the logs and make sure the traffic is valid.
  11. All of the connections - are multiple from the same IP addresses? (more than usual ) use this to check how many connections are coming from 1 ip: netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n
  12. You could also work some with Mod_Evasive
  13. Depending upon your findings - move MySQL to another server
  14. Think about a load balancer - or Nginx or moving from an Apache webhosting solution to another like Cherokee, Nginx, etc...

If this post has helped you - why don't you vote for it :-) Blessings

share|improve this answer

A few other things in addition to Glenn's excellent list:

  • Check 'top' and 'free' to ensure you are not using any swap memory as this will kill your performance. If you find you are beginning to use swap then reduce the memory requirements of Apache (reduce MaxClients mainly) and MySQL (all the various cache/buffer options).
  • If the forum is PHP make sure you are running an opcode cache like eAccelerator or APC.
  • Consider testing the site's performance using something like ab or siege. This will give you the current capabilities of your server and allow you to test the effect of specific optimizations.
  • Use top to see what applications are using up the CPU at peak hours. This will give you a basic idea of where to start optimizing.
  • If you are serving a lot of static content consider using a lighter weight web server for just that (such as lighttpd or nginx).
  • Check the query log stats in MySQL to make sure it is enabled and operating well. If you are getting a lot of "LOW MEM Prunes" consider using more memory for the cache if you can.
  • You may get the best performance if you give more memory to MySQL rather than Apache. Ideally you want your active record set to be able to be held entirely in RAM which minimizes disk access. This is not the total size of the database, just the size of all records that are typically read during each day. On a 4GB machine I would make sure MySQL gets at least 1GB overall.
  • Be aware that traffic typically comes in surges and your server needs to not just handle the average traffic rate but the traffic peaks. Don't get in a situation where your setup can just handle the average traffic but begins to fall behind when the traffic peaks/surges. You are then in a situation where the server is struggling to keep up but just keeps getting more and more overloaded.

Just from my own experience your server 'should' be enough to support a 20k views/day site with a good configuration and some optimization tweaks. I wouldn't be surprised if you can theoretically get 10x that or more with some work.

share|improve this answer
This is my top command, it doesnt look like to me we are using too much swap. top - 08:42:52 up 5 days, 22:32, 1 user, load average: 1.84, 1.68, 1.67 Tasks: 212 total, 1 running, 210 sleeping, 0 stopped, 1 zombie Cpu(s): 26.4%us, 8.0%sy, 0.0%ni, 65.6%id, 0.0%wa, 0.0%hi, 0.1%si, 0.0%st Mem: 6229204k total, 5533100k used, 696104k free, 138836k buffers Swap: 4200988k total, 12k used, 4200976k free, 4369616k cached – Jake Feb 21 '11 at 13:44

Not the answer you're looking for? Browse other questions tagged or ask your own question.