From e1f43575c4c666aab3b00c3f78a625cb81a6e25e Mon Sep 17 00:00:00 2001 From: Adrian Date: Tue, 14 Jun 2022 04:36:10 -0700 Subject: added thread count def. param on class instantiation --- bin/stress_ng_test.py | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) (limited to 'bin') diff --git a/bin/stress_ng_test.py b/bin/stress_ng_test.py index 35aad2d..e9ea3b1 100755 --- a/bin/stress_ng_test.py +++ b/bin/stress_ng_test.py @@ -58,12 +58,14 @@ class StressNg(): stressors, wrapper_timeout, sng_timeout, + thread_count, extra_options=""): self.stressors = stressors self.wrapper_timeout = wrapper_timeout self.sng_timeout = sng_timeout self.extra_options = extra_options + self.thread_count = thread_count self.results = "" self.returncode = 0 @@ -71,10 +73,12 @@ class StressNg(): """Run a stress-ng test, storing results in self.results.""" stressor_list = "--" + " 0 --".join(self.stressors) - command = "stress-ng --aggressive --verify --timeout {} {} {} 0". \ + # 0 + command = "stress-ng --aggressive --verify --timeout {} {} {} %i". \ format(self.sng_timeout, self.extra_options, - stressor_list) + stressor_list, + self.thread_count) time_str = time.strftime("%d %b %H:%M", time.gmtime()) if len(self.stressors) == 1: print("{}: Running stress-ng {} stressor for {:.0f} seconds...". @@ -221,11 +225,19 @@ def stress_memory(args): 'stream', 'tsearch', 'vm-rw', 'wcs', 'zero', 'mlock', 'mmapfork', 'mmapmany', 'mremap', 'shm-sysv', 'vm-splice'] + crt_stressors = crt_stressors[0:8] + if num_numa_nodes() > 1: crt_stressors.append('numa') # Variable-run-time stressors -- run longer on systems with more RAM.... vrt_stressors = ['malloc', 'mincore', 'vm', 'bigheap', 'brk', 'mmap'] + vrt_stressors = vrt_stressors[0:3] + # stack, bigheap, brk + ltc_stressors = ['stack', 'bigheap', 'brk'] + + # add random selection of n stressors + # and/or increase timeout(s) est_runtime = len(crt_stressors) * args.base_time + \ len(vrt_stressors) * vrt @@ -234,12 +246,22 @@ def stress_memory(args): for stressor in crt_stressors: test_object = StressNg(stressors=stressor.split(), sng_timeout=args.base_time, - wrapper_timeout=args.base_time*2) + wrapper_timeout=args.base_time * 2, + thread_count=0) retval = retval | test_object.run() print(test_object.results) for stressor in vrt_stressors: - test_object = StressNg(stressors=stressor.split(), sng_timeout=vrt, - wrapper_timeout=vrt*2) + test_object = StressNg(stressors=stressor.split(), + sng_timeout=vrt, + wrapper_timeout=vrt * 2, + thread_count=0) + retval = retval | test_object.run() + print(test_object.results) + for stressor in ltc_stressors: + test_object = StressNg(stressors=stressor.split(), + sng_timeout=vrt, + wrapper_timeout=vrt * 2, + thread_count=8) retval = retval | test_object.run() print(test_object.results) if my_swap is not None and args.keep_swap is False: @@ -271,7 +293,7 @@ def stress_disk(args): est_runtime = len(disk_stressors) * args.base_time print("Using test directory: '{}'".format(test_disk.test_dir)) print("Estimated total run time is {:.0f} minutes\n". - format(est_runtime/60)) + format(est_runtime / 60)) retval = 0 if not args.simulate: for stressor in disk_stressors: @@ -279,7 +301,7 @@ def stress_disk(args): "--hdd-opts dsync --readahead-bytes 16M -k" test_object = StressNg(stressors=stressor.split(), sng_timeout=args.base_time, - wrapper_timeout=args.base_time*5, + wrapper_timeout=args.base_time * 5, extra_options=disk_options) retval = retval | test_object.run() print(test_object.results) -- cgit v1.2.3 From 813cc460f437eb650d10f87e46890133342bf94b Mon Sep 17 00:00:00 2001 From: Adrian Date: Thu, 7 Jul 2022 01:14:47 -0700 Subject: updates to throttle test --- bin/stress_ng_test.py | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'bin') diff --git a/bin/stress_ng_test.py b/bin/stress_ng_test.py index e9ea3b1..fd5937f 100755 --- a/bin/stress_ng_test.py +++ b/bin/stress_ng_test.py @@ -73,8 +73,8 @@ class StressNg(): """Run a stress-ng test, storing results in self.results.""" stressor_list = "--" + " 0 --".join(self.stressors) - # 0 - command = "stress-ng --aggressive --verify --timeout {} {} {} %i". \ + + command = "stress-ng --aggressive --verify --timeout {} {} {} {}". \ format(self.sng_timeout, self.extra_options, stressor_list, @@ -134,8 +134,6 @@ def stress_cpu(args): return retval -# Define memory-related functions... - def num_numa_nodes(): """Return the number of NUMA nodes supported by the CPU.""" @@ -221,24 +219,19 @@ def stress_memory(args): # Constant-run-time stressors -- run them for the same length of time on # all systems.... crt_stressors = ['bsearch', 'context', 'hsearch', 'lsearch', 'matrix', - 'memcpy', 'null', 'pipe', 'qsort', 'stack', 'str', + 'memcpy', 'null', 'pipe', 'qsort', 'str', 'stream', 'tsearch', 'vm-rw', 'wcs', 'zero', 'mlock', 'mmapfork', 'mmapmany', 'mremap', 'shm-sysv', 'vm-splice'] - crt_stressors = crt_stressors[0:8] if num_numa_nodes() > 1: crt_stressors.append('numa') # Variable-run-time stressors -- run longer on systems with more RAM.... - vrt_stressors = ['malloc', 'mincore', 'vm', 'bigheap', 'brk', 'mmap'] - vrt_stressors = vrt_stressors[0:3] + vrt_stressors = ['malloc', 'mincore', 'vm', 'mmap'] # stack, bigheap, brk ltc_stressors = ['stack', 'bigheap', 'brk'] - # add random selection of n stressors - # and/or increase timeout(s) - est_runtime = len(crt_stressors) * args.base_time + \ len(vrt_stressors) * vrt print("Estimated total run time is {:.0f} minutes\n". @@ -261,7 +254,7 @@ def stress_memory(args): test_object = StressNg(stressors=stressor.split(), sng_timeout=vrt, wrapper_timeout=vrt * 2, - thread_count=8) + thread_count=8) # throttle to 8 threads retval = retval | test_object.run() print(test_object.results) if my_swap is not None and args.keep_swap is False: -- cgit v1.2.3 From c56b6a07c77f6668380dcc1b5ed68d417ad96209 Mon Sep 17 00:00:00 2001 From: Adrian Date: Thu, 7 Jul 2022 12:46:16 -0700 Subject: updates to throttle test --- bin/stress_ng_test.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'bin') diff --git a/bin/stress_ng_test.py b/bin/stress_ng_test.py index fd5937f..e21fe53 100755 --- a/bin/stress_ng_test.py +++ b/bin/stress_ng_test.py @@ -134,6 +134,8 @@ def stress_cpu(args): return retval +# Define memory-related functions... + def num_numa_nodes(): """Return the number of NUMA nodes supported by the CPU.""" -- cgit v1.2.3 From cc60603c50259631a25cbe842d14e9a9def1f84c Mon Sep 17 00:00:00 2001 From: Adrian Date: Wed, 13 Jul 2022 03:25:28 -0700 Subject: minor comment cleanup for bin/stress_ng_test.py --- bin/stress_ng_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/stress_ng_test.py b/bin/stress_ng_test.py index e21fe53..5f3b9a5 100755 --- a/bin/stress_ng_test.py +++ b/bin/stress_ng_test.py @@ -231,7 +231,7 @@ def stress_memory(args): # Variable-run-time stressors -- run longer on systems with more RAM.... vrt_stressors = ['malloc', 'mincore', 'vm', 'mmap'] - # stack, bigheap, brk + # Low-thread-count stressors -- throttle to >8 threads... ltc_stressors = ['stack', 'bigheap', 'brk'] est_runtime = len(crt_stressors) * args.base_time + \ -- cgit v1.2.3