{"id":111,"date":"2015-03-07T17:01:15","date_gmt":"2015-03-07T17:01:15","guid":{"rendered":"http:\/\/eliteservermanagement.com\/issues\/?p=111"},"modified":"2015-03-16T14:42:39","modified_gmt":"2015-03-16T14:42:39","slug":"how-to-investigate-load-issue","status":"publish","type":"post","link":"https:\/\/eliteservermanagement.com\/issues\/how-to-investigate-load-issue\/","title":{"rendered":"How to investigate load issue"},"content":{"rendered":"<p>Get your current sysload:-<br \/>\n18:54:44 up 22 days, 22:47, 1 user, load average: 2.54, 2.69, 2.40<br \/>\nUSER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT<br \/>\nkarlo pts\/0 5ed07f32.cm-7-1b 18:49 0.00s 0.09s 0.00s w<br \/>\ncat \/proc\/loadavg<br \/>\n2.49 2.68 2.39 1\/149 2085<br \/>\nThe load on server is around 2.5. This means before an interrupt (program call) is done, it has to wait for 2.5 tasks. It\u2019s like a queue. On a 20 core system, a system load of 2 would be no problem. If it is a 2 core system then we need to investigate the issue as below:-<\/p>\n<p>1. Check for CPU usage using top or htop.<\/p>\n<p>2 High IO<\/p>\n<p>High input\/output on your disks can lead to a high sysload. You can use iostat and iotop to investigate this. You might have to install them first. On RHEL based systems, iostat is in the package sysstat.<\/p>\n<p>To get the current IO, try \u201ciostat 1?:<br \/>\niostat 1:- Below is the output:-<\/p>\n<p>Linux 3.2.2 (srv02.leanback.eu) 06\/26\/2013 _x86_64_ (2 CPU)<\/p>\n<p>avg-cpu: %user %nice %system %iowait %steal %idle<br \/>\n0.53 0.14 1.19 2.73 0.25 95.16<\/p>\n<p>Device: tps kB_read\/s kB_wrtn\/s kB_read kB_wrtn<br \/>\nxvdap1 0.84 2.63 2.59 5222348 5128012<br \/>\nxvdap2 5.87 33.14 44.00 65726181 87260968<\/p>\n<p>avg-cpu: %user %nice %system %iowait %steal %idle<br \/>\n0.50 0.00 0.50 75.38 0.00 23.62<\/p>\n<p>Device: tps kB_read\/s kB_wrtn\/s kB_read kB_wrtn<br \/>\nxvdap1 0.00 0.00 0.00 0 0<br \/>\nxvdap2 46.00 0.00 788.00 0 788<\/p>\n<p>avg-cpu: %user %nice %system %iowait %steal %idle<br \/>\n0.00 0.00 0.00 49.49 0.00 50.51<\/p>\n<p>Device: tps kB_read\/s kB_wrtn\/s kB_read kB_wrtn<br \/>\nxvdap1 0.00 0.00 0.00 0 0<br \/>\nxvdap2 7.00 0.00 32.00 0 32<\/p>\n<p>If you have high read\/write numbers, this is the problem. Investigate what process is causing it with iotop.<\/p>\n<p>iotop<\/p>\n<p>&nbsp;<\/p>\n<p>The process at the top is the one which uses most IO. There might be something wrong there. Kill it.<br \/>\nStill if not fixed, then check if the system is swapping<\/p>\n<p>If your system is using swap, this can lead to a high system load. Check out your memory usage with \u2018free\u2019:<\/p>\n<p>$ free -m<br \/>\ntotal used free shared buffers cached<br \/>\nMem: 990 958 32 0 27 276<br \/>\n-\/+ buffers\/cache: 653 336<br \/>\nSwap: 1023 73 950<br \/>\nAs can be seen above, total of about 1GB RAM . There is only 32MB left. And it has used Swap (see the Swap row, and then under the \u2018free\u2019 column). This is not a good sign. Scroll back to the part about htop, and sort on memory. This will tell you what is using your precious RAM.<\/p>\n<p>If that is done, you can:<br \/>\n1) Clear your SWAP. Only so this if you have enough free memory. As root, do: \u201cswapoff -a; swapon -a\u201d.<br \/>\n2) Disable swap as much as possible. As root, do \u201cecho vm.swappiness=0 &gt;&gt; \/etc\/sysctl.conf \u201d and reboot. This will make sure your system only swapps if it is out of memory.<br \/>\nIf still you are having problems then check for hardware. For example, if a HDD is broken, or your RAID array is rebuilding, this will impact performance (and system load). You might want to check your dmesg output \u201d dmesg | less \u201d for errors. There might be something in \/var\/log\/messages .<br \/>\nIf your HDDs and bios support SMART, you might get info from there. Install smartmontools , find out what devices your file systems are on ( cat \/etc\/fstab | cut -d\u2019 \u2018 -f1 | grep -v none ) and scan them:<br \/>\n$ sudo smartctl -a \/dev\/sda<\/p>\n<p>by-<\/p>\n<p><a href=\"http:\/\/eliteservermanagement.com\/\"><b>eLite Server Management<\/b><\/a><\/p>\n<p>We Specialize In cPanel Server Management<br \/>\nAffordable 24\/7 Technical Support Company<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Get your current sysload:- 18:54:44 up 22 days, 22:47, 1 user, load average: 2.54, 2.69, 2.40 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT karlo pts\/0 5ed07f32.cm-7-1b 18:49 0.00s 0.09s 0.00s w cat \/proc\/loadavg 2.49 2.68 2.39 1\/149 2085 The load on server is around 2.5. This means before an interrupt (program call) is done, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[12],"tags":[29],"aioseo_notices":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/eliteservermanagement.com\/issues\/wp-json\/wp\/v2\/posts\/111"}],"collection":[{"href":"https:\/\/eliteservermanagement.com\/issues\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/eliteservermanagement.com\/issues\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/eliteservermanagement.com\/issues\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/eliteservermanagement.com\/issues\/wp-json\/wp\/v2\/comments?post=111"}],"version-history":[{"count":3,"href":"https:\/\/eliteservermanagement.com\/issues\/wp-json\/wp\/v2\/posts\/111\/revisions"}],"predecessor-version":[{"id":280,"href":"https:\/\/eliteservermanagement.com\/issues\/wp-json\/wp\/v2\/posts\/111\/revisions\/280"}],"wp:attachment":[{"href":"https:\/\/eliteservermanagement.com\/issues\/wp-json\/wp\/v2\/media?parent=111"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/eliteservermanagement.com\/issues\/wp-json\/wp\/v2\/categories?post=111"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/eliteservermanagement.com\/issues\/wp-json\/wp\/v2\/tags?post=111"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}