performance - Detect system load with emphasis on "swap thrashing" in Linux -


I created a Bash prompt, when the working directory is a Git repository, displays the name of the current repository. In addition, it includes ongoing work and time spent on it (from a HomeBride timekeeping tool). This, of course, means that just the prompt means to run two processes.

There is a lack of that if the system is cracking for any reason, then it is necessary to save Killall system, such as git Binary is too much ask the system in such a situation.

So, now the prompt is disabled by default, and is only enabled on demand, but it is not as simple as it would be good to detect load in .bashrc And if the system is running fine (with acceptable disk latency only) will enable the prompt.

In such situations, the CPU is quite cheap, only discs are expensive. So, I want to find a way that finds out the beating on the basis of external utilities.

Indication: can be useful in such as / proc / loadavg will solve my problem if this is the CPU which causes obstacles Is formed, not the disc

vmstat can help you if you do not want to use it , Then

  • / proc / meminfo
  • / proc / stat
  • / proc / pid / state

Comments