How to automatically check for heavy processes at regular intervals

Asked 2 years ago, Updated 2 years ago, 131 views

How do I automatically check heavy processes at regular intervals?

I'd like to investigate when the load is on during the night, weekends, and holidays.

I have a vague image like creating a shell and starting it at regular intervals in the scheduler, but
Linux is a beginner and I don't know how to do it.

Please let me know if there is a good way to avoid overloading the server.

The environment is Red Hat Enterprise Linux 6.3.

linux rhel

2022-09-30 19:48

1 Answers

If you use cron, how about registering 32**root/bin/ps-A-Opcpu -- sort-pcpu|head>/path/to/log/dir/pslog-$(date+%Y%m%d%H%M%S) in ?
Sort all processes in descending order of cpu utilization and log 10 from the top.

If you want to change the information you want to log, do mamps to see the OUTPUT MODIFIERS section.


2022-09-30 19:48

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.