1f08c3bdfSopenharmony_ciUSAGE
2f08c3bdfSopenharmony_ci
3f08c3bdfSopenharmony_ciSee the program's usage statement by invoking with --help.
4f08c3bdfSopenharmony_ci
5f08c3bdfSopenharmony_ciNOTES
6f08c3bdfSopenharmony_ci
7f08c3bdfSopenharmony_ciThis program works really well for me, but it might not have some of the
8f08c3bdfSopenharmony_cifeatures that you want.  If you would like, please extend the code and send
9f08c3bdfSopenharmony_cime the patch[1].  Enjoy the program :-)
10f08c3bdfSopenharmony_ci
11f08c3bdfSopenharmony_ciPlease use the context diff format.  That is: save the original program
12f08c3bdfSopenharmony_cias stress.c.orig, then make and test your desired changes to stress.c, then
13f08c3bdfSopenharmony_cirun 'diff -u stress.c.orig stress.c' to produce a context patch.  Thanks.
14f08c3bdfSopenharmony_ci
15f08c3bdfSopenharmony_ciAmos Waterland <apw@rossby.metr.ou.edu>
16f08c3bdfSopenharmony_ciNorman, Oklahoma
17f08c3bdfSopenharmony_ci27 Nov 2001
18f08c3bdfSopenharmony_ci
19f08c3bdfSopenharmony_ciEXAMPLES
20f08c3bdfSopenharmony_ci[examples]
21f08c3bdfSopenharmony_ci
22f08c3bdfSopenharmony_ciThe simple case is that you just want to bring the system load average up to
23f08c3bdfSopenharmony_cian arbitrary value.  The following forks 13 processes, each of which spins
24f08c3bdfSopenharmony_ciin a tight loop calculating the sqrt() of a random number acquired with
25f08c3bdfSopenharmony_cirand().
26f08c3bdfSopenharmony_ci
27f08c3bdfSopenharmony_ci  % stress -c 13
28f08c3bdfSopenharmony_ci
29f08c3bdfSopenharmony_ciLong options are supported, as well as is making the output less verbose.
30f08c3bdfSopenharmony_ciThe following forks 1024 processes, and only reports error messages if any.
31f08c3bdfSopenharmony_ci
32f08c3bdfSopenharmony_ci  % stress --quiet --hogcpu 1k
33f08c3bdfSopenharmony_ci
34f08c3bdfSopenharmony_ciTo see how your system performs when it is I/O bound, use the -i switch.
35f08c3bdfSopenharmony_ciThe following forks 4 processes, each of which spins in a tight loop calling
36f08c3bdfSopenharmony_cisync(), which is a system call that flushes memory buffers to disk.
37f08c3bdfSopenharmony_ci
38f08c3bdfSopenharmony_ci  % stress -i 4
39f08c3bdfSopenharmony_ci
40f08c3bdfSopenharmony_ciMultiple hogs may be combined on the same command line.  The following does
41f08c3bdfSopenharmony_cieverything the preceding examples did in one command, but also turns up the
42f08c3bdfSopenharmony_civerbosity level as well as showing how to cause the command to
43f08c3bdfSopenharmony_ciself-terminate after 1 minute.
44f08c3bdfSopenharmony_ci
45f08c3bdfSopenharmony_ci  % stress -c 13 -i 4 --verbose --timeout 1m
46f08c3bdfSopenharmony_ci
47f08c3bdfSopenharmony_ciAn value of 0 normally denotes infinity.  The following is how to do a fork
48f08c3bdfSopenharmony_cibomb (be careful with this).
49f08c3bdfSopenharmony_ci
50f08c3bdfSopenharmony_ci  % stress -c 0
51f08c3bdfSopenharmony_ci
52f08c3bdfSopenharmony_ciFor the -m and -d options, a value of 0 means to redo their operation an
53f08c3bdfSopenharmony_ciinfinite number of times.  To allocate and free 128MB in a redo loop use the
54f08c3bdfSopenharmony_cifollowing command.  This can be useful for "bouncing" against the system RAM
55f08c3bdfSopenharmony_ciceiling.
56f08c3bdfSopenharmony_ci
57f08c3bdfSopenharmony_ci  % stress -m 0 --hogvm-bytes 128M
58f08c3bdfSopenharmony_ci
59f08c3bdfSopenharmony_ciFor the -m and -d options, a negative value of n means to redo the operation
60f08c3bdfSopenharmony_ciabs(n) times.  Here is now to allocate and free 5MB three times in a row.
61f08c3bdfSopenharmony_ci
62f08c3bdfSopenharmony_ci  % stress -m -3 --hogvm-bytes 5m
63f08c3bdfSopenharmony_ci
64f08c3bdfSopenharmony_ciYou can write a file of arbitrary length to disk.  The file is created with
65f08c3bdfSopenharmony_cimkstemp() in the current directory, the default is to unlink it, but
66f08c3bdfSopenharmony_ciunlinking can be overridden with the --hoghdd-noclean flag.
67f08c3bdfSopenharmony_ci
68f08c3bdfSopenharmony_ci  % stress -d 1 --hoghdd-noclean --hoghdd-bytes 13
69f08c3bdfSopenharmony_ci
70f08c3bdfSopenharmony_ciLarge file support is enabled.
71f08c3bdfSopenharmony_ci
72f08c3bdfSopenharmony_ci  % stress -d 1 --hoghdd-noclean --hoghdd-bytes 3G
73