

The amount of built in tools that do this vary between distributions. Monitoring network utilisation is arguably as important as your CPU and memory. Memcpu() echo "- Top 10 cpu eating process -" ps auxf | sort -nr -k 3 | head -10 Įcho "- Top 10 memory eating process -" ps auxf | sort -nr -k 4 | head -10 bashrc or in a shell script, this will allow you to execute it at intervals using the at command or schedule with cron or perhaps combine it with another script to make further analysis over time. More information on the syntax and output of vmstat is available here (or use man vmstat).įinally as an text based alternative you can brew this function in your. If you wish to run vmstat continuously use 0 as the sample number.

By default vmstat will show you the output of the CPU load, memory/swap and block I/O, when it runs its 100 samples, it will give you the averages over the time samples for, in this case 100 seconds. Will make a sample each second and will perform the sample 100 times. Vmstat normally takes two arguments: the sample time and the number of samples to measure. Like top, vmstat is almost ubiquitous in availability for each Linux version. Note as well that virtualised guest servers might not give the true CPU & I/O figures as these can vary dynamically based on the hypervisor settings. It is ugly looking in comparison to htop but once you understand the display it can be highly effective in understanding what's going on with the system except network utilisation. To analyse the average CPU, memory and disk I/O load over a measured amount of time, use the vmstat tool. Htop real time cpu analyser Analysing CPU, Memory and Disk I/O over a measured time Use the F6 button in htop to sort by CPU or memory etc. When it comes to figuring out the long term load on a machine or understanding how much memory and network bandwidth is being used can be a little more of a challenge if you aren't aware of the tools out there. Sure, it's easy enough to see which process is hogging the CPU with tools like 'top' or its fancier brother, htop. Here is a bunch of handy tips for today that will likely remain in your armoury forever.Īs a Linux sysadmin it's sometimes difficult to visualise just what is causing a performance problem.
