Note that it uses the free command to see the effect of the stressing. The higher the number of CPUs specified, the faster the loads will ramp up.Ī second watch-it script ( watch-it-2) can be used to gauge the effect on system memory usage. With the -cpu option, the stress command uses a square-root function to force the CPUs to work hard. ![]() The stress tool is a workload generator that provides CPU, memory and disk I/O stress tests. One of these is called “stress” and can stress the system in a number of ways. $ kill %1 %2 %3 %4Īnother way to create system stress involves using a tool that was specifically built to stress the system for you. If you’re unsure, use the jobs command to verify the job IDs. To stop the loops, issue a kill command like this one below – assuming the job numbers are 1-4 as was shown earlier in this post. In the output, you can see how the load averages increase and then start going down again once the loops have been ended. If you intend to run tests like this periodically, you can put the loop command into a script: #!/bin/bash In this case, the uptime command is run every 30 seconds: $ while true do uptime sleep 30 done To observe the effect on load averages, use a command like the one shown below. Both the job numbers and process IDs are displayed. $ for i in 1 2 3 4 do while : do : done & done Typed on the command line, this command will start four endless loops in the background. for i in 1 2 3 4 do while : do : done & done ![]() You can increase the number of loops by adding digits or using a bash expression like in place of "1 2 3 4". In the command below, we kick off four endless loops. The results can easily be seen using the uptime or similar commands. This technique burdens the CPUs by greatly increasing the load. This first technique involves running some loops on the command line and watching how they affect the system.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |