github.com/coreos/rocket@v1.30.1-0.20200224141603-171c416fac02/tests/rkt-monitor/README.md (about) 1 # rkt-monitor 2 3 This is a small go utility intended to monitor the CPU and memory usage of rkt 4 and its children processes. This is accomplished by exec'ing rkt, reading proc 5 once a second for a specified duration, and printing the results. 6 7 This utility has a handful of flags: 8 9 ``` 10 Usage: 11 rkt-monitor IMAGE [flags] 12 13 Examples: 14 rkt-monitor mem-stresser.aci -v -d 30s 15 16 Flags: 17 -f, --to-file[=false]: Save benchmark results to files in a temp dir 18 -w, --output-dir="/tmp": Specify directory to write results 19 -p, --rkt-dir="": Directory with rkt binary 20 -s, --stage1-path="": Path to Stage1 image to use, default: coreos 21 -d, --duration="10s": How long to run the ACI 22 -h, --help[=false]: help for rkt-monitor 23 -r, --repetitions=1: Numbers of benchmark repetitions 24 -o, --show-output[=false]: Display rkt's stdout and stderr 25 -v, --verbose[=false]: Print current usage every second 26 ``` 27 28 Some acbuild scripts and golang source code is provided to build ACIs that 29 attempt to eat up resources in different ways. 30 31 An example usage: 32 33 ``` 34 $ ./tests/rkt-monitor/build-stresser.sh all 35 Building worker... 36 Beginning build with an empty ACI 37 Setting name of ACI to appc.io/rkt-cpu-stresser 38 Copying host:build-rkt-1.13.0+git/target/bin/cpu-stresser to aci:/worker 39 Setting exec command [/worker] 40 Writing ACI to cpu-stresser.aci 41 Ending the build 42 Beginning build with an empty ACI 43 Setting name of ACI to appc.io/rkt-mem-stresser 44 Copying host:build-rkt-1.13.0+git/target/bin/mem-stresser to aci:/worker 45 Setting exec command [/worker] 46 Writing ACI to mem-stresser.aci 47 Ending the build 48 Beginning build with an empty ACI 49 Setting name of ACI to appc.io/rkt-log-stresser 50 Copying host:build-rkt-1.13.0+git/target/bin/log-stresser to aci:/worker 51 Setting exec command [/worker] 52 Writing ACI to log-stresser.aci 53 Ending the build 54 $ sudo ./build-rkt-1.13.0+git/target/bin/rkt-monitor log-stresser.aci -r 3 -d 10s 55 ld-linux-x86-64(29641): seconds alive: 10 avg CPU: 28.948348% avg Mem: 3 mB peak Mem: 3 mB 56 systemd(29698): seconds alive: 10 avg CPU: 0.000000% avg Mem: 4 mB peak Mem: 4 mB 57 systemd-journal(29700): seconds alive: 10 avg CPU: 89.878237% avg Mem: 7 mB peak Mem: 7 mB 58 worker(29705): seconds alive: 10 avg CPU: 8.703743% avg Mem: 5 mB peak Mem: 6 mB 59 load average: Load1: 2.430000 Load5: 1.560000 Load15: 1.100000 60 container start time: 2539.947085ms 61 container stop time: 14.724007ms 62 systemd-journal(29984): seconds alive: 10 avg CPU: 88.553202% avg Mem: 7 mB peak Mem: 7 mB 63 worker(29989): seconds alive: 10 avg CPU: 8.415344% avg Mem: 5 mB peak Mem: 6 mB 64 ld-linux-x86-64(29890): seconds alive: 10 avg CPU: 28.863746% avg Mem: 3 mB peak Mem: 3 mB 65 systemd(29982): seconds alive: 10 avg CPU: 0.000000% avg Mem: 4 mB peak Mem: 4 mB 66 load average: Load1: 2.410000 Load5: 1.600000 Load15: 1.120000 67 container start time: 2771.857209ms 68 container stop time: 15.30096ms 69 systemd(30270): seconds alive: 10 avg CPU: 0.000000% avg Mem: 4 mB peak Mem: 4 mB 70 systemd-journal(30272): seconds alive: 10 avg CPU: 88.863170% avg Mem: 7 mB peak Mem: 7 mB 71 worker(30277): seconds alive: 10 avg CPU: 8.503793% avg Mem: 5 mB peak Mem: 6 mB 72 ld-linux-x86-64(30155): seconds alive: 10 avg CPU: 29.522864% avg Mem: 3 mB peak Mem: 3 mB 73 load average: Load1: 2.270000 Load5: 1.600000 Load15: 1.120000 74 container start time: 2641.468717ms 75 container stop time: 14.610641ms 76 ```