Or whatever time you want, of course, using s,m,h,d,y (seconds, minutes, hours, days, years). timeout 30s tells stress to stop after 30 seconds. hdd 4 pummels your hard drive with writes, by calling the write function in a loop. vm 2 thrashes your RAM by forking 2 processes to allocate and release memory. Running this one by itself and trying out different values will give you an idea of your I/O performance. This speeds up performance because disk I/O is slower than RAM. Most Linux filesystems use delayed allocation that is, data are held in memory for a period of time before being written to disk. sync() flushes any data buffered in memory to disk. io 4 forks 4 processes that call the sync() function in a loop. Compute to the last digit the value of pi?” And why? This is similar, a way to keep the CPU constantly busy. Are there any geezers out there who remember who said “Computer. Each process calculates the square root of a random number (by calling the sqrt() and rand functions) in a loop that stops at the end of your timeout, or when you stop it with CTRL+c. Let’s walk through this so we know what it’s doing. If it did detect errors, it would either try to tell you what they were, or tell you to examine the syslog. When it finishes with “successful run completed” that means there were no errors. That snippet shows I wasn’t kidding about the hogs. Stress: info: successful run completed in 13s Stress: dbug: using backoff sleep of 42000us Stress: dbug: using backoff sleep of 54000us Stress: info: dispatching hogs: 8 cpu, 4 io, 2 vm, 4 hdd This simple invocation puts a light load on the CPU, I/O, memory, and hard drive: > stress -cpu 8 -io 4 -vm 2 -hdd 4 -timeout 30s -verbose It operates by siccing a bunch of hogs on your system. Now that Stresslinux is booted up and you have gazed upon your eth0 and sensor outputs, what’s next? Let’s spend some time with the stress command, because that is a good general-purpose workload generator. (STRG+Fn on German keyboards, which is the same as CTRL+Fn.) F10 displays eth0 throughput (see above), F11 shows hard disk temperatures, and F12 displays lm-sensors readings. On US keyboards you can switch between these with ALT+Fn. There are 6 ordinary ttys on F1-F6, and it boots to tty1 on F1. Stresslinux uses the Fn keys in an interesting way. The Busybox command reference should help you. Busybox is a single stripped-down binary containing several dozen commands, and it uses the ash shell, so you may find that some of your favorite options are missing. Stresslinux uses Busybox in place of the usual coreutils, fileutils, and other standard Linux commands. If you like playing with test builds there are a ton of ’em. It was built with SUSE Studio, and is based on OpenSUSE. This is not your ordinary stripped-down Linux. You can re-run this anytime after boot by deleting /tmp/sensors and then running the sl-wizard.sh script as root, like this: rm sl-wizard.sh Exploring Stresslinux When you boot up, you have the option to allow sl-wizard to probe your system for sensors and then load the appropriate drivers (see the screen shot, below). There are good instructions for creating your chosen boot medium. My favorite is a USB stick because it is fast. Stresslinux runs from external bootable media: CD, USB stick, PXE boot, or you can run the VMWare image. Why, you ask, would anyone want to torture their nice hardware? Perhaps “torture” isn’t the best word think load-testing to expose defects, “burning in” a new machine, or to figure out some limits for overclocking. Stresslinux is a lean, mean torture machine with 750MB of hardware-pummeling goodness for probing and load-testing your computer’s hardware.
0 Comments
Leave a Reply. |