aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/run_tests/performance/scenario_config.py
diff options
context:
space:
mode:
authorGravatar Sree Kuchibhotla <sreek@google.com>2017-01-30 09:17:12 -0800
committerGravatar Sree Kuchibhotla <sreek@google.com>2017-01-30 09:17:12 -0800
commit6b446b601e239eba900b333089634f2546272d16 (patch)
tree7c5285d9d794ea72f8414144b879b10b2ffb07a5 /tools/run_tests/performance/scenario_config.py
parentb5517ddf654978e510e0243c891b225867b26c07 (diff)
parent7233a7676f2ffeb9ea8278f32fddb679adef381c (diff)
Merge branch 'master' into poll-cv-disable
Diffstat (limited to 'tools/run_tests/performance/scenario_config.py')
-rw-r--r--tools/run_tests/performance/scenario_config.py56
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 d516182c9c..1856093140 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)
@@ -103,10 +84,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,
@@ -147,14 +142,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))
@@ -256,6 +252,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(),