Help needed in Tweaing Server Load

Discussion in 'Site & Server Administration' started by sumeetrajaggarwal, Feb 16, 2010.

  1. #1
    Hi I have a
    Intel Xeon 3210 (Quad Core) with a 4 GB DDR Memory and Apache/2.2.14 (Unix). The server load is frequently going upto like 40 then 75. What could be the reasons. Someone help me. :confused:
     
    sumeetrajaggarwal, Feb 16, 2010 IP
  2. maestria

    maestria Well-Known Member

    Messages:
    705
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    110
    #2
    The exact reason can be determined after analysis of what are the services that are currently running inside the server.
    Is it a plain web server?
     
    maestria, Feb 17, 2010 IP
  3. proudbabys

    proudbabys Peon

    Messages:
    43
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Have you checked your server logs to see whats causing this?
     
    proudbabys, Feb 17, 2010 IP
  4. sumeetrajaggarwal

    sumeetrajaggarwal Peon

    Messages:
    185
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Actually there were few popular sites which were rcving too many visitors. So support made php to fcgi which reduced the load. However now one of the sites is throwing 500 errors and behaving indifferent. :(
     
    sumeetrajaggarwal, Feb 17, 2010 IP
  5. jakd

    jakd Peon

    Messages:
    155
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    when the server load is high, get the output of 'top' command. It will show you the name of the process causing the load spikes.
     
    jakd, Feb 17, 2010 IP
  6. Ashley Merrick

    Ashley Merrick Greenhorn

    Messages:
    52
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    18
    #6
    Do you have SUPHP installed, this could be the cause of the 500 error's when changing to fcgi, as SUPHP will throw a 500 error if the folder's and file's do not have the correct permission's set.

    Do any of your sites rely on heavily on MYSQL, have you done any optimization to the file /etc/my.cnf if not then post the contents of the file here, as well as the top few lines of a "TOP" output and we can help you further then.
     
    Ashley Merrick, Feb 17, 2010 IP
  7. sumeetrajaggarwal

    sumeetrajaggarwal Peon

    Messages:
    185
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Before I had SUPHP then my support changed to FCGI to reduce the load. But then I started getting 500 errors and the following error too:

    [notice] mod_fcgid: call /home/username/public_html/index.php with wrapper /usr/local/cpanel/cgi-sys/php5

    So they again changed to SUPHP. I have mailed then again.

    Permission for the index.php file is set to 644. I haven't done anything to my.cnf maybe the support would have done. And Yes the site relies too much on Mysql its a Magento installation.
     
    sumeetrajaggarwal, Feb 17, 2010 IP
  8. sumeetrajaggarwal

    sumeetrajaggarwal Peon

    Messages:
    185
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    here look at the top when load is very high:

    top - 11:01:31 up 91 days, 11:26,  1 user,  load average: 85.81, 69.10, 62.33
    Tasks: 232 total,  55 running, 165 sleeping,   0 stopped,  12 zombie
    Cpu(s): 82.8%us, 16.9%sy,  0.0%ni,  0.0%id,  0.0%wa,  0.0%hi,  0.3%si,  0.0%st
    Mem:   4151872k total,  3799932k used,   351940k free,   556100k buffers
    Swap:  5678936k total,       88k used,  5678848k free,  1979032k cached
    
      PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND           
     6027 mysql     15   0  196m 106m 5480 S 95.4  2.6   1671:15 mysqld             
    28670 nobody    18   0  305m  96m 1936 S 29.3  2.4   0:03.14 httpd              
     9882 nobody    18   0  339m 113m 3016 S 25.3  2.8   4:00.64 httpd              
     9780 nobody    18   0  340m 114m 5404 S 17.6  2.8   3:03.13 httpd              
    29249 freeware  17   0 38168  23m 6476 R 13.0  0.6   0:00.39 php                
     9756 nobody    18   0  336m 111m 3004 S 12.0  2.8   2:10.76 httpd              
    29231 freeware  15   0 39976  24m 6456 S  9.0  0.6   0:00.28 php                
     9561 nobody    21   0  344m 113m 3008 S  7.6  2.8   1:46.88 httpd              
    29262 freeware  16   0 36976  21m 6448 S  7.6  0.5   0:00.23 php                
    29258 freeware  16   0 36324  21m 6452 R  7.3  0.5   0:00.22 php                
    29064 freeware  18   0 39216  24m 6452 R  6.0  0.6   0:00.23 php                
    29248 freeware  16   0 33600  18m 6176 R  6.0  0.5   0:00.18 php                
     9696 nobody    18   0  334m 107m 5264 S  4.7  2.7   1:43.18 httpd              
    29068 freeware  18   0 39948  24m 6452 R  3.3  0.6   0:00.24 php                
    29120 freeware  18   0 34912  19m 6236 R  3.3  0.5   0:00.20 php                
    29260 freeware  16   0 28584  13m 6096 R  3.3  0.3   0:00.10 php                
    29071 freeware  15   0     0    0    0 Z  1.7  0.0   0:00.38 php <defunct>   
    Code (markup):
     
    sumeetrajaggarwal, Feb 17, 2010 IP
  9. RHS-Chris

    RHS-Chris Well-Known Member

    Messages:
    1,007
    Likes Received:
    35
    Best Answers:
    10
    Trophy Points:
    150
    #9
    It looks like you need to do some MySQL tuning. What do you currently have listed in your /etc/my.cnf file?
     
    RHS-Chris, Feb 18, 2010 IP
  10. chrisj383

    chrisj383 Well-Known Member

    Messages:
    754
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    130
    #10
    The user "freeware" is using all of the CPU/Memory. What is this user hosting? Optimize the MySQL
     
    chrisj383, Feb 18, 2010 IP
  11. sumeetrajaggarwal

    sumeetrajaggarwal Peon

    Messages:
    185
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    How do I tune up mysql?? :confused:

    freeware is hosting a wordpress blog but its kind of too popular.
     
    sumeetrajaggarwal, Feb 18, 2010 IP
  12. jakd

    jakd Peon

    Messages:
    155
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #12
    jakd, Feb 18, 2010 IP
  13. eadler25

    eadler25 Peon

    Messages:
    217
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #13
    i think you are using cronjobs for sql

    are you using any cron jobs ???
     
    eadler25, Feb 18, 2010 IP
  14. sumeetrajaggarwal

    sumeetrajaggarwal Peon

    Messages:
    185
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #14
    hi we changed to fcgi and since then load is very low

    top - 23:54:37 up 92 days, 20 min,  1 user,  load average: 0.76, 0.83, 0.86
    Tasks: 180 total,   1 running, 179 sleeping,   0 stopped,   0 zombie
    Cpu(s):  5.0%us,  0.3%sy,  0.0%ni, 94.5%id,  0.0%wa,  0.0%hi,  0.2%si,  0.0%st
    Mem:   4151872k total,  3301956k used,   849916k free,   487880k buffers
    Swap:  5678936k total,       88k used,  5678848k free,  1744536k cached
    
      PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND           
    18581 nobody    19   0  313m  91m 3056 S  9.0  2.3   0:21.27 httpd              
    17331 freeware  15   0 46420  28m 8324 S  7.0  0.7   2:08.04 php5               
    16094 nobody    18   0  324m 101m 3104 S  1.3  2.5   2:18.34 httpd              
    19192 assistmy  16   0 31540  11m 6672 S  1.3  0.3   0:03.87 php5               
     9053 nobody    19   0  314m  92m 3152 S  1.0  2.3   1:52.23 httpd              
     6027 mysql     21   0  197m 107m 5480 S  0.7  2.7   2220:12 mysqld             
     9055 nobody    19   0  315m  93m 3132 S  0.3  2.3   2:12.68 httpd              
        1 root      15   0  2072  576  500 S  0.0  0.0   0:03.92 init               
        2 root      RT  -5     0    0    0 S  0.0  0.0   0:45.97 migration/0        
        3 root      34  19     0    0    0 S  0.0  0.0   0:09.71 ksoftirqd/0        
        4 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 watchdog/0         
        5 root      RT  -5     0    0    0 S  0.0  0.0   0:33.62 migration/1        
        6 root      34  19     0    0    0 S  0.0  0.0   0:32.30 ksoftirqd/1        
        7 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 watchdog/1         
        8 root      RT  -5     0    0    0 S  0.0  0.0   0:37.66 migration/2        
        9 root      34  19     0    0    0 S  0.0  0.0   0:11.94 ksoftirqd/2        
       10 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 watchdog/2      
    Code (markup):


    But after fcgi I am getting problem with one site it is throwing 500 internal server error most of the time and even when the page loads in the header it is giving status as 500 instead of 200. :mad:
     
    sumeetrajaggarwal, Feb 18, 2010 IP
  15. RHS-Chris

    RHS-Chris Well-Known Member

    Messages:
    1,007
    Likes Received:
    35
    Best Answers:
    10
    Trophy Points:
    150
    #15
    RHS-Chris, Feb 18, 2010 IP
  16. sumeetrajaggarwal

    sumeetrajaggarwal Peon

    Messages:
    185
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #16
    Error log is showing:

    [Fri Feb 19 00:34:31 2010] [notice] mod_fcgid: call /home/username/public_html/index.php with wrapper /usr/local/cpanel/cgi-sys/php5
    Code (markup):
     
    sumeetrajaggarwal, Feb 18, 2010 IP
  17. RHS-Chris

    RHS-Chris Well-Known Member

    Messages:
    1,007
    Likes Received:
    35
    Best Answers:
    10
    Trophy Points:
    150
    #17
    The log should have something like [error] in it, with a 500 code.
     
    RHS-Chris, Feb 18, 2010 IP
  18. sumeetrajaggarwal

    sumeetrajaggarwal Peon

    Messages:
    185
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #18
    Nope nothing like that. The page loads fine but the header being returned is 500 status.

    here is the website check it:

    https://www.buyrudraksha.biz/

    And what is the solution for the error I posted i.e.

    [Fri Feb 19 00:34:31 2010] [notice] mod_fcgid: call /home/username/public_html/index.php with wrapper /usr/local/cpanel/cgi-sys/php5 
    Code (markup):
     
    sumeetrajaggarwal, Feb 18, 2010 IP
  19. jakd

    jakd Peon

    Messages:
    155
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #19
    I've tried visiting the site, seems quite quick to me.. I didnt get a 500 error, however, it seems that many other visitors could be getting it, ofcourse this is based on the results I see on the hosttracker

    http://a.picr.us/?v=capturex.png

    it shows that 4/10 see the site normally while the others get a 500 error. check your logs again and see what gives you a php 500 error.
     
    jakd, Feb 18, 2010 IP
  20. sumeetrajaggarwal

    sumeetrajaggarwal Peon

    Messages:
    185
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #20
    The load problem is solved now but my site is getting 500 errors can anyone help with this. I think there is some problem with fcgi. How can I check if fcgi is configured properly?
     
    sumeetrajaggarwal, Feb 18, 2010 IP