Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Any good script to discover high load cause on Linux?
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Any good script to discover high load cause on Linux?

Hello,

is there any good linux script that will output some short and useful info on high server load average cause?

i mean not just top processes (CPU, RAM), but also HDD transactions per second, network load. So it will analyse all these and output some short info (maybe one screen output) which will tell me if the cause is HDD/CPU or whatever and shows top processes that are causing this.

I would run such script during high load to e-mail me what happens during high load event.

In my case it is CentOS + apache + mysql server with HW raid 1

Thank You

Comments

  • You could use something like this as a baseline for example: http://www.inmotionhosting.com/support/website/server-usage/create-server-load-monitoring-bash-script

    And then use some math to derive some kind of value representing an overall performance measure. You could include iostat for the HDD transaction part and put in something like nethogs to account for network usage per process.
    Do some tests and try to evaluate your methodology and determine valid trigger points and viola: Nice solution you could share with us! :D

  • ps,{systat|vmstat|iostat} are generally distributed with the system.

  • mfsmfs Banned, Member

    I were rushing to say "htop" as well, but maybe netdata fits the bill for you

    https://my-netdata.io/

    it looks like bloat but it turns out to be pretty lightweight

    it supports alarms via mail/telegram/slack/whatever

  • atop.

    But like all other similar utilities it doesn't analyse; it simply collects data which you can then analyse.

    One advantage of atop is that you also see the processes and that you can tell it to look more often, say, every 3 seconds, or less often, e.g. once a minute (standard is once about every 10 or 20 sec).

    And it comes with another utility called atopsar that makes it easy for you to see a kind of resume which comes quite close to what you want. If you need deeper analysis, however, you'll need to make a script.

  • @stolipeach said:
    Htop

    Thanks for the advice, the command is really easy to be used.

  • eva2000eva2000 Veteran
    edited February 2017

    @postcd said:
    Hello,

    is there any good linux script that will output some short and useful info on high server load average cause?

    i mean not just top processes (CPU, RAM), but also HDD transactions per second, network load. So it will analyse all these and output some short info (maybe one screen output) which will tell me if the cause is HDD/CPU or whatever and shows top processes that are causing this.

    I would run such script during high load to e-mail me what happens during high load event.

    In my case it is CentOS + apache + mysql server with HW raid 1

    Thank You

    I wrote my own called mysqlmymonlite.sh used for years on my servers and clients - can gather all stats listed on https://mysqlmymon.com/ demo in less than <12 seconds. Useful as an overview of a new clients server - saves going back and forth asking for such and such info. The read text instructions in the zip download also outline how you can setup a cronjob to either auto log each run's results to a text file or email them to you at scheduled run interval :)

    Should support nginx, apache and litespeed/openlitespeed

    note there's 3 versions of the script in separate folders in downloded zip file

    You can also add your own custom commands to mysqlmymonlite.sh so if you need more stats or specific programs run - see https://mysqlmymon.com/#custom

    All sensitive server hostname info has been masked and rewritten to just show the words 'yourhostname' instead of your real hostname making it anonymous. So suited to sharing publicly i.e. asking for server tuning advice and sharing output.

    enjoy !

    Thanked by 1postcd
  • I use both net-data and Glances (https://nicolargo.github.io/glances/) and of course a mixture of iotop, htop, atop, top, iptraf and many others XD

    Thanked by 1arda
  • @piohost said:
    I use both net-data and Glances (https://nicolargo.github.io/glances/) and of course a mixture of iotop, htop, atop, top, iptraf and many others XD

    My eyes like glances, too. But I'm not using or recommending it because it devours about the same resources on a VPS as a medium website incl. web and sql server!

    That's the ugly side of Python (which I loved a lot): It has become a fat, bloated pig.

Sign In or Register to comment.