Results 1 to 18 of 18

Hybrid View

  1. #1
    Join Date
    Jul 2006
    Posts
    166

    Load Average Problem

    Hello friends, l need help to solve this problem.


    top - 18:34:32 up 1 day, 8:35, 1 user, load average: 16.78, 10.47, 6.53
    Tasks: 215 total, 1 running, 212 sleeping, 0 stopped, 2 zombie
    Cpu(s): 0.4%us, 1.1%sy, 0.0%ni, 0.0%id, 98.0%wa, 0.2%hi, 0.3%si, 0.0%st
    Mem: 16615788k total, 8661792k used, 7953996k free, 395928k buffers
    Swap: 2104496k total, 0k used, 2104496k free, 6589264k cached

    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
    3004 mysql 15 0 2924m 856m 3388 S 6.3 5.3 377:38.37 mysqld
    13991 nobody 18 0 63988 28m 3892 S 4.0 0.2 0:00.12 httpd
    608 root 10 -5 0 0 0 D 1.3 0.0 2:08.12 md1_raid1
    13970 nobody 16 0 65668 38m 10m D 0.7 0.2 0:00.73 httpd
    1047 root 15 0 2540 1172 804 R 0.3 0.0 1:14.26 top
    1 root 15 0 2160 600 520 S 0.0 0.0 0:01.02 init
    2 root RT -5 0 0 0 S 0.0 0.0 0:00.16 migration/0
    3 root 34 19 0 0 0 S 0.0 0.0 0:00.00 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:00.00 migration/1
    6 root 34 19 0 0 0 S 0.0 0.0 0:00.00 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:00.01 migration/2
    9 root 39 19 0 0 0 S 0.0 0.0 0:00.00 ksoftirqd/2
    10 root RT -5 0 0 0 S 0.0 0.0 0:00.00 watchdog/2
    11 root RT -5 0 0 0 S 0.0 0.0 0:00.01 migration/3
    12 root 34 19 0 0 0 S 0.0 0.0 0:00.01 ksoftirqd/3
    13 root RT -5 0 0 0 S 0.0 0.0 0:00.00 watchdog/3
    14 root RT -5 0 0 0 S 0.0 0.0 0:00.00 migration/4
    15 root 34 19 0 0 0 S 0.0 0.0 0:00.01 ksoftirqd/4
    16 root RT -5 0 0 0 S 0.0 0.0 0:00.00 watchdog/4
    17 root RT -5 0 0 0 S 0.0 0.0 0:00.01 migration/5
    18 root 39 19 0 0 0 S 0.0 0.0 0:00.02 ksoftirqd/5
    19 root RT -5 0 0 0 S 0.0 0.0 0:00.00 watchdog/5
    20 root RT -5 0 0 0 S 0.0 0.0 0:00.00 migration/6
    21 root 34 19 0 0 0 S 0.0 0.0 0:00.01 ksoftirqd/6
    22 root RT -5 0 0 0 S 0.0 0.0 0:00.00 watchdog/6
    23 root RT -5 0 0 0 S 0.0 0.0 0:00.01 migration/7
    24 root 34 19 0 0 0 S 0.0 0.0 0:00.01 ksoftirqd/7
    25 root RT -5 0 0 0 S 0.0 0.0 0:00.00 watchdog/7
    26 root 10 -5 0 0 0 S 0.0 0.0 0:58.71 events/0
    27 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 events/1
    28 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 events/2
    29 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 events/3
    30 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 events/4
    31 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 events/5
    32 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 events/6
    33 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 events/7
    34 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 khelper
    35 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 kthread
    45 root 10 -5 0 0 0 S 0.0 0.0 0:00.17 kblockd/0
    46 root 10 -5 0 0 0 S 0.0 0.0 0:00.05 kblockd/1
    47 root 10 -5 0 0 0 S 0.0 0.0 0:00.01 kblockd/2

  2. #2
    It sounds to be mysql and apache causing load on your server after looking at top command statistics. You need to get both of the services optimized.

  3. #3
    Join Date
    Jul 2006
    Posts
    166
    omg, my server going to bomp!
    top - 18:49:26 up 1 day, 8:50, 1 user, load average: 36.16, 22.51, 13.68
    Tasks: 235 total, 1 running, 234 sleeping, 0 stopped, 0 zombie
    Cpu(s): 2.1%us, 5.4%sy, 0.0%ni, 3.1%id, 88.8%wa, 0.2%hi, 0.4%si, 0.0%st
    Mem: 16615788k total, 12664300k used, 3951488k free, 370384k buffers
    Swap: 2104496k total, 0k used, 2104496k free, 10522624k cached

    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
    14690 mysql 15 0 3061m 331m 3068 S 44.8 2.0 3:44.75 mysqld
    15148 nobody 16 0 72408 39m 6256 S 4.3 0.2 0:00.31 httpd
    2010 root 0 -20 0 0 0 S 4.0 0.0 3:18.21 loop0
    612 root 10 -5 0 0 0 D 2.0 0.0 3:28.51 kjournald
    608 root 10 -5 0 0 0 S 1.3 0.0 2:14.26 md1_raid1
    323 root 15 0 0 0 0 S 1.0 0.0 1:01.34 pdflush
    14699 root 15 0 2428 1104 788 R 0.7 0.0 0:01.90 top
    15164 nobody 16 0 73100 42m 9232 S 0.7 0.3 0:00.24 httpd
    322 root 15 0 0 0 0 S 0.3 0.0 1:02.22 pdflush
    2581 root 16 0 1816 568 480 D 0.3 0.0 1:26.19 syslogd
    15146 nobody 15 0 69452 42m 10m S 0.3 0.3 0:01.28 httpd
    1 root 15 0 2160 600 520 S 0.0 0.0 0:01.02 init
    2 root RT -5 0 0 0 S 0.0 0.0 0:00.16 migration/0
    3 root 34 19 0 0 0 S 0.0 0.0 0:00.00 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:00.00 migration/1
    6 root 34 19 0 0 0 S 0.0 0.0 0:00.00 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:00.01 migration/2
    9 root 34 19 0 0 0 S 0.0 0.0 0:00.00 ksoftirqd/2
    10 root RT -5 0 0 0 S 0.0 0.0 0:00.00 watchdog/2
    11 root RT -5 0 0 0 S 0.0 0.0 0:00.01 migration/3
    12 root 34 19 0 0 0 S 0.0 0.0 0:00.01 ksoftirqd/3
    13 root RT -5 0 0 0 S 0.0 0.0 0:00.00 watchdog/3
    14 root RT -5 0 0 0 S 0.0 0.0 0:00.00 migration/4
    15 root 34 19 0 0 0 S 0.0 0.0 0:00.02 ksoftirqd/4
    16 root RT -5 0 0 0 S 0.0 0.0 0:00.00 watchdog/4
    17 root RT -5 0 0 0 S 0.0 0.0 0:00.01 migration/5
    18 root 34 19 0 0 0 S 0.0 0.0 0:00.02 ksoftirqd/5
    19 root RT -5 0 0 0 S 0.0 0.0 0:00.00 watchdog/5
    20 root RT -5 0 0 0 S 0.0 0.0 0:00.00 migration/6
    21 root 34 19 0 0 0 S 0.0 0.0 0:00.01 ksoftirqd/6
    22 root RT -5 0 0 0 S 0.0 0.0 0:00.00 watchdog/6
    23 root RT -5 0 0 0 S 0.0 0.0 0:00.01 migration/7
    24 root 34 19 0 0 0 S 0.0 0.0 0:00.01 ksoftirqd/7
    25 root RT -5 0 0 0 S 0.0 0.0 0:00.00 watchdog/7
    26 root 10 -5 0 0 0 S 0.0 0.0 0:59.16 events/0
    27 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 events/1
    28 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 events/2
    29 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 events/3
    30 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 events/4
    31 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 events/5
    32 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 events/6

  4. #4
    Join Date
    Sep 2002
    Location
    Top Secret
    Posts
    14,135
    Quote Originally Posted by rcpkrc View Post
    omg, my server going to bomp!
    nonsense. I've been in (and worked in) servers with 150+ load. Of course that was an i7 870, it really is all relevant to ram and CPU.

    As others have suggested, it looks like you're running a bit of a high intensity MySQL setup, you will want to tune that a bit.
    Tom Whiting, WHMCS Guru extraordinaire
    Linux problems? WHMCS Problems? Give me a shout
    Check out my WHMCS Addons

  5. #5
    Join Date
    Mar 2011
    Location
    Italy
    Posts
    109
    Use a mysql tunner to tune your server a good example is mysqltuner.pl

  6. #6
    Join Date
    Jan 2011
    Location
    India
    Posts
    1,453

    *

    you are right. I also observed that tunning required here. Optimization also required if possible.

    Quote Originally Posted by gsofttehnic View Post
    Use a mysql tunner to tune your server a good example is mysqltuner.pl

  7. #7
    Join Date
    Mar 2011
    Location
    Las Vegas Nevada
    Posts
    33
    one thing i did on my server that stops the problem from getting worse. In php.ini there is by default a 60 SECONDS max connection time for php to wait for mysql. If mysql is running on the same box you can safely drop this to 1 even most lans you can drop it to 1. So when mysql get over loaded it dosen't cause a chain reaction with apache repeatedly asking.

    Had this issuse with a large database backup 1.5gb eating up tones of ram from apache waiting on mysql to finish and unlock the tables.

  8. #8
    Quote Originally Posted by kingofkya View Post
    one thing i did on my server that stops the problem from getting worse. In php.ini there is by default a 60 SECONDS max connection time for php to wait for mysql. If mysql is running on the same box you can safely drop this to 1 even most lans you can drop it to 1. So when mysql get over loaded it dosen't cause a chain reaction with apache repeatedly asking.

    Had this issuse with a large database backup 1.5gb eating up tones of ram from apache waiting on mysql to finish and unlock the tables.
    When I backup my mysql database, I simply stop the webserver then do the backup then start whatever webserver you're using. Unless your database is shared by multiple sites though.

  9. #9
    Join Date
    Mar 2011
    Location
    Las Vegas Nevada
    Posts
    33
    Yeah thats exactly the problem Multiple servers. Dosen't matter too mutch as that works for me. only about 3 min of downtime.
    Last edited by kingofkya; 04-18-2011 at 02:03 AM.

  10. #10
    You wait time is very high, which suggest the bottleneck is harddrive.

    I could suggest increasing the cache size for mysql since you have so much ram left.

    May be some sort of php accelerator for your apache.

    Perhaps also look at your storage subsystem and see if there is anyway you can reduce the load, such as disabling apache log (if you don't need it)

    Or something is causing the slowness of your server, for example degraded raid5/6 array, incorrectly set harddrive parameters. Note that messing around with harddrive settings can cause data corruption.

  11. #11
    Join Date
    Jul 2006
    Posts
    166
    l am having ded from server4you. do they offer these kind of support issues? this server is optimized by a populer system admin in this forums.
    l am still searching a solution.

  12. #12
    Join Date
    Mar 2011
    Location
    Italy
    Posts
    109
    in this case paste here your etc/my.cnf to see your optimization

  13. #13
    Disk i/o.....

    You need to get MySQL using more RAM sd you have plenty available and should get Memcached going to cache some queries.
    << Please review signature guidelines >>

  14. #14
    Join Date
    Jul 2006
    Posts
    166
    is there a possibility to write a script to reboot apache and mysql services when load average become over 10 in my server?

  15. #15
    Join Date
    Jun 2009
    Location
    Inside WHT !
    Posts
    67
    Try this:

    #!/bin/bash
    loadavg=$(uptime | awk -F "." '{ print $1 }' | awk -F ":" '{ print $5 }')
    if [ "$loadavg" -ge "10" ]; then
    pkill -9 httpd
    sleep 3
    /etc/init.d/httpd restart
    /etc/init.d/mysqld restart
    fi

  16. #16
    Join Date
    Sep 2004
    Location
    Miami, FL
    Posts
    2,762
    Not really a wise idea to restart MySQL and Apache each time it goes over 10. You are not looking into the root of the problem but rather superficially trying to resolve the problem and restarting it.

    The root is your optimization of your MySQL, so you should have a look at that before even considering the restart.
    Aaron Ong
    Dedicated Servers - 100TB Servers - 100Mbps Unmetered Servers - Web Hosting - CDN Network
    Servers in Central, East/West Coast USA, EUROPE and ASIA
    Welltodo Century
    - www.welltodocentury.com

  17. #17
    Join Date
    Jun 2009
    Location
    Inside WHT !
    Posts
    67
    Yea.. I agree with aodat2.. Its not a good idea.. I just gave him the script.. thats all

  18. #18
    Join Date
    Apr 2011
    Posts
    41
    im having laggy server problems

Similar Threads

  1. Server Load Average Problem
    By indianboy in forum Hosting Security and Technology
    Replies: 35
    Last Post: 08-06-2010, 06:55 PM
  2. Need some help on a Hourly high 5 minute load average problem
    By echenail in forum Hosting Security and Technology
    Replies: 20
    Last Post: 08-06-2009, 06:13 PM
  3. Replies: 6
    Last Post: 05-19-2008, 06:07 PM
  4. Does load average on VPS is total system load ?
    By taotoon in forum Hosting Security and Technology
    Replies: 2
    Last Post: 07-05-2005, 09:27 AM
  5. Get Load Average, Ping, CPU load, etc. by using PHP
    By Milos in forum Hosting Software and Control Panels
    Replies: 2
    Last Post: 03-03-2002, 10:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •