Skip to content

Commit

Permalink
Merge pull request grpc#8035 from ctiller/OUTSTANDING
Browse files Browse the repository at this point in the history
Use a # of total outstanding requests to drive benchmark config
  • Loading branch information
ctiller authored Sep 9, 2016
2 parents 0d69264 + 15372a3 commit fce8da5
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 71 deletions.
31 changes: 12 additions & 19 deletions tools/run_tests/performance/scenario_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@

# performance scenario configuration for various languages

import math

WARMUP_SECONDS=5
JAVA_WARMUP_SECONDS=15 # Java needs more warmup time for JIT to kick in.
BENCHMARK_SECONDS=30
Expand Down Expand Up @@ -64,17 +66,17 @@
}
}

# deep is the number of RPCs outstanding on a channel in non-ping-pong tests
# (the value used is 1 otherwise)
DEEP=100
# 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)
OUTSTANDING_REQUESTS={
'async': 10000,
'sync': 1000
}

# wide is the number of client channels in multi-channel tests (1 otherwise)
WIDE=64

# For most synchronous clients, DEEP*WIDE threads will be created.
SYNC_DEEP=10
SYNC_WIDE=8


def _get_secargs(is_secure):
if is_secure:
Expand Down Expand Up @@ -140,14 +142,8 @@ def _ping_pong_scenario(name, rpc_type,
scenario['client_config']['payload_config'] = EMPTY_PROTO_PAYLOAD

if unconstrained_client:
if unconstrained_client == 'async':
deep = DEEP
wide = WIDE
elif unconstrained_client == 'sync':
deep = SYNC_DEEP
wide = SYNC_WIDE
else:
raise Exception('Illegal value of unconstrained_client option.')
wide = channels if channels is not None else WIDE
deep = int(math.ceil(1.0 * OUTSTANDING_REQUESTS[unconstrained_client] / wide))

scenario['num_clients'] = 0 # use as many client as available.
scenario['client_config']['outstanding_rpcs_per_channel'] = deep
Expand All @@ -158,9 +154,6 @@ def _ping_pong_scenario(name, rpc_type,
scenario['client_config']['client_channels'] = 1
scenario['client_config']['async_client_threads'] = 1

if channels is not None:
scenario['client_config']['client_channels'] = channels

if client_language:
# the CLIENT_LANGUAGE field is recognized by run_performance_tests.py
scenario['CLIENT_LANGUAGE'] = client_language
Expand Down Expand Up @@ -254,7 +247,7 @@ def scenarios(self):

for channels in [1, 3, 10, 31, 100, 316, 1000]:
yield _ping_pong_scenario(
'cpp_protobuf_async_unary_qps_unconstrained_%s_%d_channels' % (secstr, channels),
'cpp_protobuf_%s_unary_qps_unconstrained_%s_%d_channels' % (synchronicity, secstr, channels),
rpc_type='UNARY',
client_type='ASYNC_CLIENT', server_type='ASYNC_SERVER',
unconstrained_client=synchronicity, secure=secure,
Expand Down
Loading

0 comments on commit fce8da5

Please sign in to comment.