|
| 1 | +# Analyzing multiple workloads with multiple cgroups in parallel |
| 2 | + |
| 3 | +In some scenarios, workloads are run under different cgroups to allow different resource constraints. This section provides details on how to monitor memory usage with multiple Cgroups running concurrently. multiconfig.json, as provided in the example below, allows monitoring of 2 Cgroups. This can be further extended to more number of Cgrups. In the example below, the first ( memoryusageanalyzer1) run the baseline runs and the second Cgroup (memoryusageanalyzer2) |
| 4 | + run the dynamic squeezer |
| 5 | +``` |
| 6 | +multiconfig.json: |
| 7 | +[ |
| 8 | + { |
| 9 | + "cmd":"./workload 8 60 1000", |
| 10 | + "cgroupname":"memoryusageanalyzer1", |
| 11 | + "output":"./profile_workload1", |
| 12 | + "reclaimerconfig":"" |
| 13 | + }, |
| 14 | + { |
| 15 | + "cmd":"./workload 8 60 1000", |
| 16 | + "cgroupname":"memoryusageanalyzer2", |
| 17 | + "output":"./profile_workload2", |
| 18 | + "reclaimerconfig":"../../src/reclaimer/squeezerdynamicconfig.json" |
| 19 | + } |
| 20 | +] |
| 21 | +``` |
| 22 | + |
| 23 | +``` |
| 24 | +memory_usage_analyzer.py -m ./multiconfig.json |
| 25 | +#Sample results, actual results may vary |
| 26 | +2024-05-22 03:34:12,471 - memoryusageanalyzer - INFO - args = Namespace(verbose=False, output='profile', outputforce=None, sampleperiod=5, docker=None, cgpath='/sys/fs/cgroup', cgname='memoryusageanalyzer', reclaimerconfig=None, multiconfig='multiconfig.json', cmdoptions=[]) |
| 27 | +cgroup_path_create start |
| 28 | +cgroup_path_create CompletedProcess(args='sudo bash /mnt/nvme1/pg3/applications.benchmarking.memory-usage-analyzer/src/core/cgroup_config.sh /sys/fs/cgroup memoryusageanalyzer1 root ', returncode=0) |
| 29 | +2024-05-22 03:34:12,492 - memoryusageanalyzer - INFO - **** Storing profiling results in ./profile_workload1.9 |
| 30 | +2024-05-22 03:34:12,496 - memoryusageanalyzer - INFO - cgroup v2 enabled and memory controller detected |
| 31 | +2024-05-22 03:34:12,496 - memoryusageanalyzer - INFO - **** In run Starting |
| 32 | +workload start |
| 33 | +2024-05-22 03:34:12,500 - memoryusageanalyzer - INFO - **** Starting job in cgroup |
| 34 | +2024-05-22 03:34:12,502 - memoryusageanalyzer - INFO - **** Starting stats |
| 35 | +cgroup_path_create start |
| 36 | +cgroup_path_create CompletedProcess(args='sudo bash /mnt/nvme1/pg3/applications.benchmarking.memory-usage-analyzer/src/core/cgroup_config.sh /sys/fs/cgroup memoryusageanalyzer2 root ', returncode=0) |
| 37 | +2024-05-22 03:34:12,529 - memoryusageanalyzer - INFO - **** Storing profiling results in ./profile_workload2.9 |
| 38 | +2024-05-22 03:34:12,605 - memoryusageanalyzer - INFO - cgroup v2 enabled and memory controller detected |
| 39 | +2024-05-22 03:34:12,605 - memoryusageanalyzer - INFO - **** In run Starting |
| 40 | +workload start |
| 41 | +2024-05-22 03:34:12,608 - memoryusageanalyzer - INFO - **** Starting job in cgroup |
| 42 | +2024-05-22 03:34:12,611 - memoryusageanalyzer - INFO - **** Starting stats |
| 43 | +2024-05-22 03:34:12,613 - memoryusageanalyzer - INFO - **** Starting reclaimer |
| 44 | +memory usage = 864,256 pf_rate = 0.0 => squeeze percent = 1% |
| 45 | +[INFO] (main:43) : pid = 7717 |
| 46 | +[INFO] (main:44) : memory = 8 GiB = 2097152 pages |
| 47 | +[INFO] (main:45) : hot timer = 60 sec |
| 48 | +[INFO] (main:46) : loops = 1000 |
| 49 | + squeeze to 855,613 -- ok |
| 50 | +[INFO] (main:43) : pid = 7724 |
| 51 | +[INFO] (main:44) : memory = 8 GiB = 2097152 pages |
| 52 | +[INFO] (main:45) : hot timer = 60 sec |
| 53 | +[INFO] (main:46) : loops = 1000 |
| 54 | +[INFO] (main:60) : Done with setup in 3 seconds. |
| 55 | +[INFO] (main:60) : Done with setup in 3 seconds. |
| 56 | +memory usage = 8,608,489,472 pf_rate = 14.8 => squeeze percent = 2% |
| 57 | + squeeze to 8,436,319,682 -- ok |
| 58 | +memory usage = 8,607,981,568 pf_rate = 16119.4 => squeeze percent = 0% |
| 59 | +memory usage = 8,607,981,568 pf_rate = 0.0 => squeeze percent = 1% |
| 60 | + squeeze to 8,521,901,752 -- ok |
| 61 | +memory usage = 8,521,850,880 pf_rate = 0.0 => squeeze percent = 2% |
| 62 | + squeeze to 8,351,413,862 -- ok |
| 63 | +memory usage = 8,351,191,040 pf_rate = 0.0 => squeeze percent = 3% |
| 64 | + squeeze to 8,100,655,308 -- ok |
| 65 | +memory usage = 8,100,462,592 pf_rate = 0.0 => squeeze percent = 4% |
| 66 | + squeeze to 7,776,444,088 -- ok |
| 67 | +memory usage = 7,776,321,536 pf_rate = 0.0 => squeeze percent = 5% |
| 68 | + squeeze to 7,387,505,459 -- ok |
| 69 | +[INFO] (main:77) : Done with test in 37 seconds. |
| 70 | +memory usage = 7,387,156,480 pf_rate = 0.0 => squeeze percent = 6% |
| 71 | +2024-05-22 03:34:52,774 - memoryusageanalyzer - INFO - **** Job finished |
| 72 | +2024-05-22 03:34:52,774 - memoryusageanalyzer - INFO - **** Stopping stats |
| 73 | +**** Closing ./profile_workload1.9/baseline/stats.csv.gz |
| 74 | + squeeze to 6,943,927,091./profile_workload1.9/baseline |
| 75 | +Generating plots ./profile_workload1.9/baseline/memoryusageanalyzer-plots.html |
| 76 | +Loading stats from ./profile_workload1.9/baseline/stats.csv.gz |
| 77 | +Loading stats from ./profile_workload1.9/baseline/stats.csv.gz |
| 78 | +*** Totals without page cache *** |
| 79 | +Maximum active+swap memory = 8.029 GiB |
| 80 | +Max active memory = 8.0 GiB |
| 81 | +Max swap memory = 0.0 GiB |
| 82 | +Max page cache = 0.010 GiB |
| 83 | +Swap memory = 0.0% |
| 84 | +Max inactive anon = 8.002 GiB |
| 85 | +Maximum zpool memory = 0.831486 GiB |
| 86 | +Maximum zram memory = 0.000019 GiB |
| 87 | +incompressible data ratio(zram)= 66.7% |
| 88 | +full total memory pressure = 0 us |
| 89 | +Average swap memory comp ratio = 2.00 |
| 90 | +Potential maximum compression savings in percent = -0.0% |
| 91 | +Potential median compression savings in percent = -3.0% |
| 92 | +Potential compression savings in bytes = -0.001 GiB |
| 93 | +Average swap memory comp ratio = 2.00 (including same filled pages) |
| 94 | +Major PFs/sec (median, avg, max) = 0.00 0.00 0.00 |
| 95 | +Total PFs/sec (median, avg, max) = 0.00 51639.35 361475.42 |
| 96 | +Total PFs (Major+Minor) = 1814311 |
| 97 | +Major PFs = 0 |
| 98 | +sampling period = 5.01918227331979 |
| 99 | + -- ok |
| 100 | +
|
| 101 | +[INFO] (main:77) : Done with test in 40 seconds. |
| 102 | +2024-05-22 03:34:56,111 - memoryusageanalyzer - INFO - **** Job finished |
| 103 | +2024-05-22 03:34:56,111 - memoryusageanalyzer - INFO - **** Stopping stats |
| 104 | +memory usage = 393,216 pf_rate = 25.0 => squeeze percent = 7% |
| 105 | + squeeze to 365,690 -- ok |
| 106 | +**** Closing ./profile_workload2.9/dynamic/stats.csv.gz |
| 107 | +2024-05-22 03:34:58,161 - memoryusageanalyzer - INFO - **** Stopping reclaimer |
| 108 | +**** Squeezer exiting |
| 109 | +./profile_workload2.9/dynamic |
| 110 | +Generating plots ./profile_workload2.9/dynamic/memoryusageanalyzer-plots.html |
| 111 | +Loading stats from ./profile_workload2.9/dynamic/stats.csv.gz |
| 112 | +Loading stats from ./profile_workload2.9/dynamic/stats.csv.gz |
| 113 | +*** Totals without page cache *** |
| 114 | +Maximum active+swap memory = 8.017 GiB |
| 115 | +Max active memory = 8.0 GiB |
| 116 | +Max swap memory = 2.5 GiB |
| 117 | +Max page cache = 0.000 GiB |
| 118 | +Swap memory = 30.7% |
| 119 | +Max inactive anon = 7.576 GiB |
| 120 | +Maximum zpool memory = 1.210579 GiB |
| 121 | +Maximum zram memory = 0.000019 GiB |
| 122 | +incompressible data ratio(zram)= 66.7% |
| 123 | +full total memory pressure = 671112 us |
| 124 | +Average swap memory comp ratio = 2.00 |
| 125 | +Potential maximum compression savings in percent = 2.8% |
| 126 | +Potential median compression savings in percent = 4.5% |
| 127 | +Potential compression savings in bytes = 0.226 GiB |
| 128 | +Average swap memory comp ratio = 2.00 (including same filled pages) |
| 129 | +Major PFs/sec (median, avg, max) = 0.00 2293.66 18349.26 |
| 130 | +Total PFs/sec (median, avg, max) = 0.00 47318.79 360200.84 |
| 131 | +Total PFs (Major+Minor) = 1899099 |
| 132 | +Major PFs = 92054 |
| 133 | +sampling period = 5.016767889261246 |
| 134 | +``` |
0 commit comments