Prográmky: cpulimit, stress, crashme
Tři zajímavé prográmky, které mi přišly pod ruku.
cpulimit
limits the cpu usage of a process
cpulimit is a simple program that attempts to limit the cpu usage of a process (expressed in percentage, not in cpu time). This is useful to control batch jobs, when you don't want them to eat too much cpu. It does not act on the nice value or other priority stuff, but on the real cpu usage. Besides it is able to adapt itself to the overall system load, dynamically and quickly.
Jak je patrné z popisu, program slouží k omezování spotřeby CPU nenažranými procesy. Ty lze omezit (a později i osvobodit) přímo za běhu. Proces můžeme hledat podle PID nebo jména binárky. Viz příklad:
$ sudo cpulimit -e firefox-bin -l 60 Warning: no target process found. Waiting for it... Process 6308 detected
stress
A tool to impose load on and stress test a computer system
stress is a tool that imposes a configurable amount of CPU, memory, I/O, or disk stress on a POSIX-compliant operating system and reports any errors it detects.
stress is not a benchmark. It is a tool used by system administrators to evaluate how well their systems will scale, by kernel programmers to evaluate perceived performance characteristics, and by systems programmers to expose the classes of bugs which only or more frequently manifest themselves when the system is under heavy load.
Program stress naopak dokáže CPU i jiné zdroje pořádně vytížit. Pohleďme do manuálu:
-c, --cpu N
spawn N workers spinning on sqrt()
-i, --io N
spawn N workers spinning on sync()
-m, --vm N
spawn N workers spinning on malloc()/free()
-d, --hdd N
spawn N workers spinning on write()/unlink()
crashme
Stress tests operating system stability
crashme generates strings of random bytes and then attempts to execute them. Used to test kernel stability.
**WARNING** While Linux has been known to survive days and weeks of crashme, IT IS NOT GUARANTEED THAT YOUR SYSTEM WILL SURVIVE! DO NOT USE THIS PROGRAM UNLESS YOU REALLY WANT TO CRASH YOUR COMPUTER
A tahle legrácka už tolik užitečná není, ale zase mi přijde docela vtipná.
Zdroj: aptitude