The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

High php load for no reason! Please help!

Discussion in 'General Discussion' started by Kh@lid, Jul 15, 2006.

  1. Kh@lid

    Kh@lid Member

    Joined:
    Apr 29, 2003
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    I have a server with one single website, yes it has many visitors but it is hard to browse the pages (nuke and vb) becase it is so slow. The load of the server is very high. And even when I stop mysql, the load is still high, it doesn't go down unless I stop httpd!

    Once I start httpd, the load jumps up instantly. I've tried every single thing to know the source of the problem but I couldn't. I installed a php Eaccelerator and rebuilt apache, but everything remined the same.

    I've used the Show Current CPU Usage function on WHM, and I found "php" and "mysql" are on the top, and when I click on the pids, and then trace, lines written on the screen and it doesn't end!

    Please look at the attachment picture of the "top" and tell me if you can find something wrong!


    Thanks in advance!



    Khalid
     

    Attached Files:

    • top.JPG
      top.JPG
      File size:
      105 KB
      Views:
      83
  2. AndyReed

    AndyReed Well-Known Member
    PartnerNOC

    Joined:
    May 29, 2004
    Messages:
    2,222
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Minneapolis, MN
    The CPU load is 6.5. That's not very high since you have a high traffic Web site. Are you sure you are not under DoS or DDoS attacks? If not, then you might be under Intrusion Attacks. To learn the difference between these attacks, go to: http://servertune.com/kbase/security/attacks.html
     
  3. flashweb

    flashweb Well-Known Member

    Joined:
    Mar 13, 2003
    Messages:
    243
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    It can caused by some attacks or poor PHP scripts.

    To see if there is an attack, try running netstat

    netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort

    See if any IP have lot of requests, if yes, ban them with firewall.
     
  4. koolcards

    koolcards Well-Known Member

    Joined:
    Oct 8, 2003
    Messages:
    146
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Tampa, Fl
    not many processes and your memory swap looks good so it's probably php being kept open waiting for mysql queries to close.
    increase the amount of sort memory available to mysql in /etc/my.cnf, depending on the amount you have installed. Play with these until it smooths out.

    [mysqld]
    set-variable = key_buffer=128M
    set-variable = max_allowed_packet=1M
    set-variable = table_cache=128
    set-variable = sort_buffer=2m
    set-variable = net_buffer_length=128K
    set-variable = myisam_sort_buffer_size=128M

    [isamchk]
    set-variable = key_buffer=128M
    set-variable = sort_buffer=128M
    set-variable = read_buffer=2M
    set-variable = write_buffer=2M

    [myisamchk]
    set-variable = key_buffer=128M
    set-variable = sort_buffer=128M
    set-variable = read_buffer=2M
    set-variable = write_buffer=2M
     
Loading...

Share This Page