aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rwxr-xr-xtools/profiling/latency_profile/run_latency_profile.sh2
-rwxr-xr-xtools/run_tests/run_microbenchmark.py9
2 files changed, 9 insertions, 2 deletions
diff --git a/tools/profiling/latency_profile/run_latency_profile.sh b/tools/profiling/latency_profile/run_latency_profile.sh
index 7ebe308e0a..715f525d2f 100755
--- a/tools/profiling/latency_profile/run_latency_profile.sh
+++ b/tools/profiling/latency_profile/run_latency_profile.sh
@@ -44,4 +44,4 @@ else
PYTHON=python2.7
fi
-$PYTHON tools/profiling/microbenchmark/bm.py bm_fullstack
+$PYTHON tools/run_tests/run_microbenchmark.py bm_fullstack
diff --git a/tools/run_tests/run_microbenchmark.py b/tools/run_tests/run_microbenchmark.py
index 7856affd8c..a5794dc9ee 100755
--- a/tools/run_tests/run_microbenchmark.py
+++ b/tools/run_tests/run_microbenchmark.py
@@ -94,7 +94,13 @@ for bm_name in sys.argv[1:]:
'--source', '%s.trace' % fnize(line), '--fmt', 'simple',
'--out', 'reports/%s.txt' % fnize(line)], timeout_seconds=None))
cleanup.append(jobset.JobSpec(['rm', '%s.trace' % fnize(line)]))
+ # periodically flush out the list of jobs: profile_analysis jobs at least
+ # consume upwards of five gigabytes of ram in some cases, and so analysing
+ # hundreds of them at once is impractical -- but we want at least some
+ # concurrency or the work takes too long
if len(benchmarks) >= min(4, multiprocessing.cpu_count()):
+ # run up to half the cpu count: each benchmark can use up to two cores
+ # (one for the microbenchmark, one for the data flush)
jobset.run(benchmarks, maxjobs=multiprocessing.cpu_count()/2,
add_env={'GRPC_TEST_PORT_SERVER': 'localhost:%d' % port_server_port})
jobset.run(profile_analysis, maxjobs=multiprocessing.cpu_count())
@@ -102,6 +108,7 @@ for bm_name in sys.argv[1:]:
benchmarks = []
profile_analysis = []
cleanup = []
+ # run the remaining benchmarks that weren't flushed
if len(benchmarks):
jobset.run(benchmarks, maxjobs=multiprocessing.cpu_count()/2,
add_env={'GRPC_TEST_PORT_SERVER': 'localhost:%d' % port_server_port})
@@ -131,4 +138,4 @@ for bm_name in sys.argv[1:]:
index_html += "</body>\n</html>\n"
with open('reports/index.html', 'w') as f:
- w.write(index_html)
+ f.write(index_html)