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.

CPU Spikes

Discussion in 'General Discussion' started by WestBend, Sep 9, 2004.

  1. WestBend

    WestBend Well-Known Member

    Joined:
    Oct 12, 2003
    Messages:
    173
    Likes Received:
    0
    Trophy Points:
    16
    I am getting the occasional CPU load spike. I am not sure how to really go about disagnosing the spikes from logs or maybe i need to setup a new log specifically to catch the spike. The last spike was between 11:40-11:55pm

    Backup occurs every morning at 3:54am according to my crontab
    Log processing as I understand it happens all the time and is not at a set time.


    Below is the TOP which seems to show my ram is at 90% usage.

    00:33:44 up 12 days, 17:04, 1 user, load average: 0.19, 0.43, 1.07
    106 processes: 103 sleeping, 2 running, 1 zombie, 0 stopped
    CPU states: 36.0% user 8.7% system 0.0% nice 0.0% iowait 55.1% idle
    Mem: 1014756k av, 913672k used, 101084k free, 0k shrd, 97480k buff
    568476k actv, 123880k in_d, 20020k in_c
    Swap: 1052248k av, 86244k used, 966004k free 638780k cached

    WHM shows the following :

    Server Load 0.42 (1 cpu)
    Memory Used 17.9 %
    Swap 0.918 %


    I ran a tail on /var/log/messages and the only thing i saw was :
    Sep 8 23:43:35 servername filelimits: Increasing file system limits succeeded

    I am not sure what the file system limits mean?


    I also had about 60 lame server requests in a 3 minute period
    ex : named[26953]: lame server resolving '188.84.5.4.in-addr.arpa' (in '84.5.4.in-addr.arpa'?): 204.166.56.179#53

    My resolv.conf appears to be setup correctly and my server has a FQDN tested at dnsreport.com

    So after all this here are the main questions :

    1 Memory Usage shown by top and by whm
    2 How can i log/check for reason for the spike
    3 Is the file system limits a cause or an indicator to the reason (what does it mean?)
    4 Is it the very large number of lame server resolving and if so how can i stop having them

    Thanks to anyone who can take the time to help me with this!
     
  2. myrem

    myrem Well-Known Member

    Joined:
    Jul 14, 2002
    Messages:
    93
    Likes Received:
    0
    Trophy Points:
    6
    Perhaps you are seeing a spike during a 'stats' run? (awstats, etc..) Your IOWait looks a bit high during the spike, meaning a great deal of disk I/O was taking place.
     
    #2 myrem, Sep 9, 2004
    Last edited: Sep 9, 2004
  3. WestBend

    WestBend Well-Known Member

    Joined:
    Oct 12, 2003
    Messages:
    173
    Likes Received:
    0
    Trophy Points:
    16
    10:00:06 up 13 days, 2:30, 1 user, load average: 2.12, 2.16, 1.82
    128 processes: 126 sleeping, 2 running, 0 zombie, 0 stopped
    CPU states: 23.1% user 11.9% system 0.0% nice 0.0% iowait 64.8% idle
    Mem: 1014756k av, 979368k used, 35388k free, 0k shrd, 93864k buff
    719724k actv, 92k in_d, 21300k in_c
    Swap: 1052248k av, 111236k used, 941012k free 716468k cached



    10:03:03 up 13 days, 2:33, 1 user, load average: 3.57, 2.26, 1.88
    126 processes: 123 sleeping, 2 running, 1 zombie, 0 stopped
    CPU states: 18.8% user 2.9% system 0.0% nice 0.0% iowait 78.1% idle
    Mem: 1014756k av, 961932k used, 52824k free, 0k shrd, 93952k buff
    702740k actv, 72k in_d, 21152k in_c
    Swap: 1052248k av, 109968k used, 942280k free 717420k cached


    10:03:28 up 13 days, 2:34, 1 user, load average: 3.55, 2.34, 1.91
    129 processes: 119 sleeping, 8 running, 2 zombie, 0 stopped
    CPU states: 92.6% user 7.3% system 0.0% nice 0.0% iowait 0.0% idle
    Mem: 1014756k av, 982796k used, 31960k free, 0k shrd, 93980k buff
    723652k actv, 4k in_d, 21152k in_c
    Swap: 1052248k av, 109956k used, 942292k free 717440k cached

    PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND
    2397 xxxxxxxx 15 0 21628 6632 1432 S 99.9 0.6 2:38 0 /usr/sbin/mysqld
    22525 xxxxxxxx 20 0 5072 5072 1452 R 17.7 0.4 0:01 0 /usr/bin/php index.php
    22523 xxxxxxxx 21 0 5612 5612 1452 R 16.7 0.5 0:01 0 /usr/bin/php index.php
    22520 xxxxxxxx 21 0 6264 6264 1452 R 15.9 0.6 0:01 0 /usr/bin/php index.php
    22522 xxxxxxxx 19 0 6532 6532 1452 R 15.9 0.6 0:01 0 /usr/bin/php index.php
    22521 xxxxxxxx 21 0 5932 5932 1452 R 15.7 0.5 0:01 0 /usr/bin/php index.php



    The mem seems extremely high. Is this the ram? I wish I could work out what exactly is causing the server load to spike and at the moment just run generally high
     
  4. myrem

    myrem Well-Known Member

    Joined:
    Jul 14, 2002
    Messages:
    93
    Likes Received:
    0
    Trophy Points:
    6
    Have you tweeked/optimized your mysql config? ( /etc/my.cnf ) ---
     
  5. WestBend

    WestBend Well-Known Member

    Joined:
    Oct 12, 2003
    Messages:
    173
    Likes Received:
    0
    Trophy Points:
    16
    haven't touched it.. as i am not sure what i should do to "tweak" it :)

    Only thing in it is : set-variable = max_connections=500

    I did see on a vBulletin site that the following is their mysql tweak.. unfortunately didn't really reference why the tweak was necessary :

    Code:
    [mysqld]
    port = 3306
    socket = /var/lib/mysql/mysql.sock
    skip-locking
    max_connections = 600
    key_buffer = 192M
    myisam_sort_buffer_size = 64M
    join_buffer_size = 1M
    read_buffer_size = 1M
    sort_buffer_size = 2M
    table_cache = 1024
    thread_cache_size = 64
    wait_timeout = 1800
    connect_timeout = 10
    max_allowed_packet = 16M
    max_connect_errors = 10
    tmp_table_size = 32M
    read_rnd_buffer_size = 524288
    query_cache_limit = 4M
    query_cache_size = 80M
    query_cache_type = 1
    skip-innodb
    
    [mysqld_safe] 
    open_files_limit = 8192
    
    [mysqldump]
    quick
    max_allowed_packet = 16M
    
    [myisamchk] 
    key_buffer = 64M 
    sort_buffer = 64M
    read_buffer = 16M
    write_buffer = 16M
    
    [mysqlhotcopy]
    interactive-timeout
     
    #5 WestBend, Sep 9, 2004
    Last edited: Sep 9, 2004
Loading...

Share This Page