diff options
author | yang-g <yangg@google.com> | 2017-01-30 09:58:46 -0800 |
---|---|---|
committer | yang-g <yangg@google.com> | 2017-01-30 09:58:46 -0800 |
commit | edcde054c623fb9c0d9a0fab3b74db3d681522c8 (patch) | |
tree | 82f92d7bc3ef163fcc093450400a44d8ad51a41c /tools/run_tests/performance | |
parent | 113b094c690bb3afd3d1d68034c7490b95b12998 (diff) | |
parent | c5492f9a89b5a5c99355ec07f041ec743769d1f0 (diff) |
Merge remote-tracking branch 'upstream/master' into health
Diffstat (limited to 'tools/run_tests/performance')
-rw-r--r-- | tools/run_tests/performance/scenario_config.py | 56 |
1 files changed, 32 insertions, 24 deletions
diff --git a/tools/run_tests/performance/scenario_config.py b/tools/run_tests/performance/scenario_config.py index b20bb40eb1..12ee12783c 100644 --- a/tools/run_tests/performance/scenario_config.py +++ b/tools/run_tests/performance/scenario_config.py @@ -48,25 +48,6 @@ HISTOGRAM_PARAMS = { 'max_possible': 60e9, } -EMPTY_GENERIC_PAYLOAD = { - 'bytebuf_params': { - 'req_size': 0, - 'resp_size': 0, - } -} -EMPTY_PROTO_PAYLOAD = { - 'simple_params': { - 'req_size': 0, - 'resp_size': 0, - } -} -BIG_GENERIC_PAYLOAD = { - 'bytebuf_params': { - 'req_size': 65536, - 'resp_size': 65536, - } -} - # target number of RPCs outstanding on across all client channels in # non-ping-pong tests (since we can only specify per-channel numbers, the # actual target will be slightly higher) @@ -102,10 +83,24 @@ def geometric_progression(start, stop, step): n *= step +def _payload_type(use_generic_payload, req_size, resp_size): + r = {} + sizes = { + 'req_size': req_size, + 'resp_size': resp_size, + } + if use_generic_payload: + r['bytebuf_params'] = sizes + else: + r['simple_params'] = sizes + + def _ping_pong_scenario(name, rpc_type, client_type, server_type, secure=True, use_generic_payload=False, + req_size=0, + resp_size=0, unconstrained_client=None, client_language=None, server_language=None, @@ -145,14 +140,15 @@ def _ping_pong_scenario(name, rpc_type, if use_generic_payload: if server_type != 'ASYNC_GENERIC_SERVER': raise Exception('Use ASYNC_GENERIC_SERVER for generic payload.') - scenario['client_config']['payload_config'] = EMPTY_GENERIC_PAYLOAD - scenario['server_config']['payload_config'] = EMPTY_GENERIC_PAYLOAD - else: - # For proto payload, only the client should get the config. - scenario['client_config']['payload_config'] = EMPTY_PROTO_PAYLOAD + scenario['client_config']['payload_config'] = _payload_type(use_generic_payload, req_size, resp_size) + scenario['server_config']['payload_config'] = _payload_type(use_generic_payload, req_size, resp_size) if unconstrained_client: outstanding_calls = outstanding if outstanding is not None else OUTSTANDING_REQUESTS[unconstrained_client] + # clamp buffer usage to something reasonable (16 gig for now) + MAX_MEMORY_USE = 16 * 1024 * 1024 * 1024 + if outstanding_calls * max(req_size, resp_size) > MAX_MEMORY_USE: + outstanding_calls = max(1, MAX_MEMORY_USE / max(req_size, resp_size)) wide = channels if channels is not None else WIDE deep = int(math.ceil(1.0 * outstanding_calls / wide)) @@ -249,6 +245,18 @@ class CXXLanguage: async_server_threads=1, secure=secure) + for size in geometric_progression(1, 1024*1024*1024+1, 8): + yield _ping_pong_scenario( + 'cpp_protobuf_%s_%s_qps_unconstrained_%s_%db' % (synchronicity, rpc_type, secstr, size), + rpc_type=rpc_type.upper(), + req_size=size, + resp_size=size, + client_type='%s_CLIENT' % synchronicity.upper(), + server_type='%s_SERVER' % synchronicity.upper(), + unconstrained_client=synchronicity, + secure=secure, + categories=[SWEEP]) + yield _ping_pong_scenario( 'cpp_protobuf_%s_%s_qps_unconstrained_%s' % (synchronicity, rpc_type, secstr), rpc_type=rpc_type.upper(), |