OLD | NEW |
(Empty) | |
| 1 #!/usr/bin/env bash |
| 2 # Copyright 2015-2016, Google Inc. |
| 3 # All rights reserved. |
| 4 # |
| 5 # Redistribution and use in source and binary forms, with or without |
| 6 # modification, are permitted provided that the following conditions are |
| 7 # met: |
| 8 # |
| 9 # * Redistributions of source code must retain the above copyright |
| 10 # notice, this list of conditions and the following disclaimer. |
| 11 # * Redistributions in binary form must reproduce the above |
| 12 # copyright notice, this list of conditions and the following disclaimer |
| 13 # in the documentation and/or other materials provided with the |
| 14 # distribution. |
| 15 # * Neither the name of Google Inc. nor the names of its |
| 16 # contributors may be used to endorse or promote products derived from |
| 17 # this software without specific prior written permission. |
| 18 # |
| 19 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 20 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 21 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 22 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 23 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 24 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 25 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 26 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 27 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 28 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 29 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 30 # |
| 31 # This script is invoked by Jenkins and runs performance smoke test. |
| 32 set -ex |
| 33 |
| 34 # Enter the gRPC repo root |
| 35 cd $(dirname $0)/../.. |
| 36 |
| 37 [[ $* =~ '--latency_profile' ]] \ |
| 38 && tools/profiling/latency_profile/run_latency_profile.sh \ |
| 39 || true |
| 40 |
| 41 config=opt |
| 42 |
| 43 make CONFIG=$config qps_worker qps_driver -j8 |
| 44 |
| 45 bins/$config/qps_worker -driver_port 10000 & |
| 46 PID1=$! |
| 47 bins/$config/qps_worker -driver_port 10010 & |
| 48 PID2=$! |
| 49 |
| 50 # |
| 51 # Put a timeout on these tests |
| 52 # |
| 53 ((sleep 900; kill $$ && killall qps_worker && rm -f /tmp/qps-test.$$ )&) |
| 54 |
| 55 export QPS_WORKERS="localhost:10000,localhost:10010" |
| 56 |
| 57 # big is the size in bytes of large messages (0 is the size otherwise) |
| 58 big=65536 |
| 59 |
| 60 # wide is the number of client channels in multi-channel tests (1 otherwise) |
| 61 wide=64 |
| 62 |
| 63 # deep is the number of RPCs outstanding on a channel in non-ping-pong tests |
| 64 # (the value used is 1 otherwise) |
| 65 deep=100 |
| 66 |
| 67 # |
| 68 # Get total core count |
| 69 cores=`grep -c ^processor /proc/cpuinfo` |
| 70 halfcores=`expr $cores / 2` |
| 71 |
| 72 for secure in true false; do |
| 73 # Scenario 1: generic async streaming ping-pong (contentionless latency) |
| 74 bins/$config/qps_driver --rpc_type=STREAMING --client_type=ASYNC_CLIENT \ |
| 75 --server_type=ASYNC_GENERIC_SERVER --outstanding_rpcs_per_channel=1 \ |
| 76 --client_channels=1 --bbuf_req_size=0 --bbuf_resp_size=0 \ |
| 77 --async_client_threads=1 --async_server_threads=1 --secure_test=$secure \ |
| 78 --num_servers=1 --num_clients=1 \ |
| 79 --server_core_limit=$halfcores --client_core_limit=0 |
| 80 |
| 81 # Scenario 2: generic async streaming "unconstrained" (QPS) |
| 82 bins/$config/qps_driver --rpc_type=STREAMING --client_type=ASYNC_CLIENT \ |
| 83 --server_type=ASYNC_GENERIC_SERVER --outstanding_rpcs_per_channel=$deep \ |
| 84 --client_channels=$wide --bbuf_req_size=0 --bbuf_resp_size=0 \ |
| 85 --async_client_threads=0 --async_server_threads=0 --secure_test=$secure \ |
| 86 --num_servers=1 --num_clients=0 \ |
| 87 --server_core_limit=$halfcores --client_core_limit=0 |& tee /tmp/qps-test.$$ |
| 88 |
| 89 # Scenario 2b: QPS with a single server core |
| 90 bins/$config/qps_driver --rpc_type=STREAMING --client_type=ASYNC_CLIENT \ |
| 91 --server_type=ASYNC_GENERIC_SERVER --outstanding_rpcs_per_channel=$deep \ |
| 92 --client_channels=$wide --bbuf_req_size=0 --bbuf_resp_size=0 \ |
| 93 --async_client_threads=0 --async_server_threads=0 --secure_test=$secure \ |
| 94 --num_servers=1 --num_clients=0 --server_core_limit=1 --client_core_limit=0 |
| 95 |
| 96 # Scenario 2c: protobuf-based QPS |
| 97 bins/$config/qps_driver --rpc_type=STREAMING --client_type=ASYNC_CLIENT \ |
| 98 --server_type=ASYNC_SERVER --outstanding_rpcs_per_channel=$deep \ |
| 99 --client_channels=$wide --simple_req_size=0 --simple_resp_size=0 \ |
| 100 --async_client_threads=0 --async_server_threads=0 --secure_test=$secure \ |
| 101 --num_servers=1 --num_clients=0 \ |
| 102 --server_core_limit=$halfcores --client_core_limit=0 |
| 103 |
| 104 # Scenario 3: Latency at sub-peak load (all clients equally loaded) |
| 105 for loadfactor in 0.7; do |
| 106 bins/$config/qps_driver --rpc_type=STREAMING --client_type=ASYNC_CLIENT \ |
| 107 --server_type=ASYNC_GENERIC_SERVER --outstanding_rpcs_per_channel=$deep \ |
| 108 --client_channels=$wide --bbuf_req_size=0 --bbuf_resp_size=0 \ |
| 109 --async_client_threads=0 --async_server_threads=0 --secure_test=$secure \ |
| 110 --num_servers=1 --num_clients=0 --poisson_load=`awk -v lf=$loadfactor \ |
| 111 '$5 == "QPS:" {print int(lf * $6); exit}' /tmp/qps-test.$$` \ |
| 112 --server_core_limit=$halfcores --client_core_limit=0 |
| 113 done |
| 114 |
| 115 rm /tmp/qps-test.$$ |
| 116 |
| 117 # Scenario 4: Single-channel bidirectional throughput test (like TCP_STREAM). |
| 118 bins/$config/qps_driver --rpc_type=STREAMING --client_type=ASYNC_CLIENT \ |
| 119 --server_type=ASYNC_GENERIC_SERVER --outstanding_rpcs_per_channel=$deep \ |
| 120 --client_channels=1 --bbuf_req_size=$big --bbuf_resp_size=$big \ |
| 121 --async_client_threads=1 --async_server_threads=1 --secure_test=$secure \ |
| 122 --num_servers=1 --num_clients=1 \ |
| 123 --server_core_limit=$halfcores --client_core_limit=0 |
| 124 |
| 125 # Scenario 5: Sync unary ping-pong with protobufs |
| 126 bins/$config/qps_driver --rpc_type=UNARY --client_type=SYNC_CLIENT \ |
| 127 --server_type=SYNC_SERVER --outstanding_rpcs_per_channel=1 \ |
| 128 --client_channels=1 --simple_req_size=0 --simple_resp_size=0 \ |
| 129 --secure_test=$secure --num_servers=1 --num_clients=1 \ |
| 130 --server_core_limit=$halfcores --client_core_limit=0 |
| 131 |
| 132 done |
| 133 |
| 134 bins/$config/qps_driver --quit=true |
| 135 |
| 136 wait |
OLD | NEW |