Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

can you help me find the bottle neck on my server. In the previous question I asked on SF, I was told that memory is no problem and I have plenty of it.

I'm curious about CPU, perhaps HDs ... what could stop me from serving double the amount of the hits, should my users increase?

do I need to do some sort of httpd.conf optimization? or php.ini optimization?

server: 16 GB DDR3-RAM ECC HDD RAID1, 2x 250 GB SATA II-HDD 7.200 rpm 2 additional 80 GB SSDs CPU 2x Intel Xeon E5520 Quadcore

software: php 5.3.6 mysql 5.5 apache 2.2.3 centos 5.5, 2.6.18-238.12.1.el5 #1 SMP Tue May 31 13:22:04 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux

current off peak hour top:

top - 16:46:17 up 2 days, 14:57,  4 users,  load average: 4.22, 3.53, 3.19
Tasks: 305 total,   4 running, 300 sleeping,   0 stopped,   1 zombie
Cpu(s): 19.1%us, 11.1%sy,  0.0%ni, 69.6%id,  0.1%wa,  0.0%hi,  0.1%si,  0.0%st
Mem:  16427200k total, 16280100k used,   147100k free,  3131684k buffers
Swap:  2104496k total,      268k used,  2104228k free,  6221860k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                                                                                                                                            
20157 apache    15   0  387m  67m 4088 S 57.5  0.4   0:21.00 httpd                                                                                                                                                                                              
 4106 apache    20   0  389m  67m 5164 R 40.9  0.4   0:59.57 httpd                                                                                                                                                                                              
20156 apache    15   0  357m  35m 5072 S 33.9  0.2   0:24.82 httpd                                                                                                                                                                                              
20148 apache    18   0  357m  35m 5052 R 31.2  0.2   0:25.00 httpd                                                                                                                                                                                              
 1759 apache    15   0  391m  69m 5188 S 29.9  0.4   4:37.24 httpd                                                                                                                                                                                              
16194 apache    18   0  358m  36m 5192 S 28.9  0.2   3:44.69 httpd                                                                                                                                                                                              
20147 apache    16   0  357m  35m 5148 S 23.6  0.2   0:26.73 httpd                                                                                                                                                                                              
17329 apache    15   0  370m  48m 5188 S 15.0  0.3   2:13.67 httpd                                                                                                                                                                                              
20140 apache    15   0  359m  37m 5136 S  8.0  0.2   0:20.53 httpd                                                                                                                                                                                              
28473 apache    15   0  358m  36m 5172 S  4.0  0.2   1:20.78 httpd                                                                                                                                                                                              
20158 apache    15   0  357m  35m 5112 S  3.7  0.2   0:22.96 httpd                                                                                                                                                                                              
26922 apache    15   0  357m  36m 5840 R  2.3  0.2   2:22.49 httpd                                                                                                                                                                                              
26925 apache    15   0  358m  36m 5188 S  2.3  0.2   1:28.63 httpd                                                                                                                                                                                              
12642 apache    15   0  357m  35m 5076 S  1.7  0.2   0:40.92 httpd                                                                                                                                                                                              
17963 apache    15   0  357m  35m 5152 S  1.7  0.2   0:27.35 httpd                                                                                                                                                                                              
 2687 apache    15   0  358m  36m 5192 S  1.0  0.2   4:28.17 httpd                                                                                                                                                                                              
 4419 mysql     15   0  668m 175m 7204 S  1.0  1.1   4:07.99 mysqld                                                                                                                                                                                             
20155 apache    16   0  368m  46m 5144 S  1.0  0.3   0:16.67 httpd                                                                                                                                                                                              
26923 apache    17   0  387m  66m 5168 S  1.0  0.4   1:42.18 httpd                                                                                                                                                                                              
 1277 apache    15   0  355m  34m 3988 S  0.7  0.2   0:11.11 httpd                                                                                                                                                                                              
 3571 root      16   0 13400 1792  848 S  0.3  0.0   3:03.17 top                                                                                                                                                                                                
32204 root      15   0 90156 3404 2648 S  0.3  0.0   0:00.19 sshd                                                                                                                                                                                               
    1 root      15   0 10372  680  572 S  0.0  0.0   0:02.04 init       
share|improve this question

2 Answers 2

I could not see any bottleneck on this printout of top:

  • you have 8 CPU-Cores(16 with hyperthreading?), 4 process needs CPU time at the moment (load)
  • you have 16GB RAM, only 6GB are really used
  • there is no waiting, so there is of course no IO-waiting

If your site is slow, you may have a look at:

  • expire headers (is static content cached on client side?)
  • your database load
  • using a reverse proxy
share|improve this answer

Everything looks fine in the output you have. What are the page load times right now? Have you run Apache Bench or anything against the server to see how it handles load? Do you have any SAR output?

You can easily stray into higher end technologies like HipHop and Flashcache without seeing any benefit.

If you suspect that your code itself is unnecessarily slow you can use something like XDebug on a development box to get profiling information. I've used this in the past to optimize critical functions in some core logic of a really complex economy application. The output can be huge, so plan for an extra 300GB of space. Software like WinCacheGrind will allow you to interpret the results.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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