Assigning a button for top or htop.
When some program chocks the CPU or memory to 100%, the keyboard too hangs.
I want to assign a button (like the lid close button or power button) for calling top or htop with nice -20 so that i can kill the application. The script which keeps watch of this event has be running with -20 nice number. Is this a good idea to implement? Any ideas? -cheers indiajoe |
Quote:
|
I was thinking of situations when it is not completely hung. Mostly my system only gets extremely slow. So do you think that running a script which watches for a particular key stroke and run top with nice -20 will be as good as assigning it to any other button on my laptop?
(Many a times i have noticed that the power button starts shutdown even when my keyboard is responding very slow) Thanking you, indiajoe |
Linux is quite efficient in how it utilizes and shares available resources among processes. Instead of searching for a way to kill processes you should find out what is or are the bottlenecks and how to make those processes play nice (more RAM, review processor and disk energy-saving states, different type of scheduler, process niceness, ionice, running certain processes sequentially like cronjobs, etc, etc). Basic tools to gather resource statistics (aka SAR) are Atop, Dstat and collectl.
|
All times are GMT -5. The time now is 08:43 PM. |