linux - Get the load, cpu usage and time of executing a bash script -


I have a bash script that I run every 5 or 15 minutes to use the crontab when it is loaded on the server I am planning to

I can find time to run the script, but use loads, memory usage and CPU usage I'm not sure how to search.

Can anyone help me?

> Any suggestions from some benchmark that will help me to decide that the script holds too much weight and should run every 15 minutes and 5 minutes.

Thanks in advance!

itemprop = "text">

You can use "top-b", top CPU usage, memory usage etc. on top Put these scripts in your script, this process will end in the background and in the form of your test overs as soon as possible.

  ssh server_name "nohup top -b-0.5> HTC & gt; file_name & amp;  

\ The above process will run in the background because & amp ;, 0.5D will give you CPU position in every 0.5 seconds, and for later analysis the output will be redirected to file_name.

To kill the process after your test, enter it in your script,

< Pre> ssh server_name "kill \ 'ps-elf | Grep 'top -b' | Grep -v grep | Sed '/ * / /' G '| Cut-D '' -f4 \ `

At the top of the order and command should be between your main test script.

< P> I think that you are running a script from the client side, do not ignore "ssh server_name".

If you are running it on the client side due to "ssh",

This will definitely resolve this issue.


Comments

Popular posts from this blog

winforms - C# Form - Property Change -

java - Messages from .properties file do not display UTF-8 characters -

javascript - amcharts makechart not working -