aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/run_tests/performance/scenario_config.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/run_tests/performance/scenario_config.py')
-rw-r--r--tools/run_tests/performance/scenario_config.py70
1 files changed, 43 insertions, 27 deletions
diff --git a/tools/run_tests/performance/scenario_config.py b/tools/run_tests/performance/scenario_config.py
index b20bb40eb1..6d138186ce 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)
@@ -92,6 +73,7 @@ def remove_nonproto_fields(scenario):
scenario.pop('CATEGORIES', None)
scenario.pop('CLIENT_LANGUAGE', None)
scenario.pop('SERVER_LANGUAGE', None)
+ scenario.pop('EXCLUDED_POLL_ENGINES', None)
return scenario
@@ -102,10 +84,25 @@ 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
+ return r
+
+
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,
@@ -114,7 +111,8 @@ def _ping_pong_scenario(name, rpc_type,
categories=DEFAULT_CATEGORIES,
channels=None,
outstanding=None,
- resource_quota_size=None):
+ resource_quota_size=None,
+ excluded_poll_engines=[]):
"""Creates a basic ping pong scenario."""
scenario = {
'name': name,
@@ -145,14 +143,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))
@@ -173,6 +172,9 @@ def _ping_pong_scenario(name, rpc_type,
scenario['SERVER_LANGUAGE'] = server_language
if categories:
scenario['CATEGORIES'] = categories
+ if len(excluded_poll_engines):
+ # The polling engines for which this scenario is excluded
+ scenario['EXCLUDED_POLL_ENGINES'] = excluded_poll_engines
return scenario
@@ -228,7 +230,8 @@ class CXXLanguage:
server_type='SYNC_SERVER',
unconstrained_client='async',
secure=secure,
- categories=smoketest_categories + [SCALABLE])
+ categories=smoketest_categories + [SCALABLE],
+ excluded_poll_engines = ['poll-cv'])
yield _ping_pong_scenario(
'cpp_protobuf_async_client_sync_server_streaming_qps_unconstrained_%s' % secstr,
@@ -237,7 +240,8 @@ class CXXLanguage:
server_type='SYNC_SERVER',
unconstrained_client='async',
secure=secure,
- categories=smoketest_categories+[SCALABLE])
+ categories=smoketest_categories+[SCALABLE],
+ excluded_poll_engines = ['poll-cv'])
for rpc_type in ['unary', 'streaming']:
for synchronicity in ['sync', 'async']:
@@ -249,6 +253,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(),