diff options
author | Michael Darakananda <pongad@google.com> | 2017-10-10 15:07:28 +1100 |
---|---|---|
committer | Michael Darakananda <pongad@google.com> | 2017-10-10 15:07:28 +1100 |
commit | df6e3750b24a584daa823e01b2a69ac65f59af83 (patch) | |
tree | 659cbc6c0021d03564b516110abd4b09bd17ce82 /tools/run_tests/performance | |
parent | b268629245788bee994e96cb585a3ab2c78bafa8 (diff) | |
parent | b6142ef1a6dc70565f468346c7935f43dbcb55fa (diff) |
Merge branch 'master' into fix-php
Diffstat (limited to 'tools/run_tests/performance')
-rwxr-xr-x | tools/run_tests/performance/build_performance.sh | 9 | ||||
-rwxr-xr-x | tools/run_tests/performance/build_performance_php7.sh | 30 | ||||
-rw-r--r-- | tools/run_tests/performance/massage_qps_stats.py | 1 | ||||
-rwxr-xr-x | tools/run_tests/performance/run_worker_php.sh | 12 | ||||
-rw-r--r-- | tools/run_tests/performance/scenario_config.py | 43 | ||||
-rw-r--r-- | tools/run_tests/performance/scenario_result_schema.json | 10 |
6 files changed, 80 insertions, 25 deletions
diff --git a/tools/run_tests/performance/build_performance.sh b/tools/run_tests/performance/build_performance.sh index e46d4e0040..e7d8db8e3e 100755 --- a/tools/run_tests/performance/build_performance.sh +++ b/tools/run_tests/performance/build_performance.sh @@ -31,6 +31,7 @@ then make CONFIG=${CONFIG} EMBED_OPENSSL=true EMBED_ZLIB=true qps_worker qps_json_driver -j8 fi +PHP_ALREADY_BUILT="" for language in $@ do case "$language" in @@ -43,6 +44,14 @@ do "go") tools/run_tests/performance/build_performance_go.sh ;; + "php7"|"php7_protobuf_c") + if [ -n "$PHP_ALREADY_BUILT" ]; then + echo "Skipping PHP build as already built by $PHP_ALREADY_BUILT" + else + PHP_ALREADY_BUILT=$language + tools/run_tests/performance/build_performance_php7.sh + fi + ;; "csharp") python tools/run_tests/run_tests.py -l $language -c $CONFIG --build_only -j 8 --compiler coreclr ;; diff --git a/tools/run_tests/performance/build_performance_php7.sh b/tools/run_tests/performance/build_performance_php7.sh new file mode 100755 index 0000000000..141c9fd1c8 --- /dev/null +++ b/tools/run_tests/performance/build_performance_php7.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# Copyright 2017 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -ex + +cd $(dirname $0)/../../.. +CONFIG=${CONFIG:-opt} +python tools/run_tests/run_tests.py -l php7 -c $CONFIG --build_only -j 8 + +# Set up all dependences needed for PHP QPS test +cd src/php/tests/qps +composer install +# Install protobuf C-extension for php +cd vendor/google/protobuf/php/ext/google/protobuf +phpize +./configure +make + diff --git a/tools/run_tests/performance/massage_qps_stats.py b/tools/run_tests/performance/massage_qps_stats.py index 9b9355308a..ebbfe6c26c 100644 --- a/tools/run_tests/performance/massage_qps_stats.py +++ b/tools/run_tests/performance/massage_qps_stats.py @@ -74,6 +74,7 @@ def massage_qps_stats(scenario_result): stats["core_http2_initiate_write_due_to_transport_flow_control_unstalled"] = massage_qps_stats_helpers.counter(core_stats, "http2_initiate_write_due_to_transport_flow_control_unstalled") stats["core_http2_initiate_write_due_to_ping_response"] = massage_qps_stats_helpers.counter(core_stats, "http2_initiate_write_due_to_ping_response") stats["core_http2_initiate_write_due_to_force_rst_stream"] = massage_qps_stats_helpers.counter(core_stats, "http2_initiate_write_due_to_force_rst_stream") + stats["core_http2_spurious_writes_begun"] = massage_qps_stats_helpers.counter(core_stats, "http2_spurious_writes_begun") stats["core_hpack_recv_indexed"] = massage_qps_stats_helpers.counter(core_stats, "hpack_recv_indexed") stats["core_hpack_recv_lithdr_incidx"] = massage_qps_stats_helpers.counter(core_stats, "hpack_recv_lithdr_incidx") stats["core_hpack_recv_lithdr_incidx_v"] = massage_qps_stats_helpers.counter(core_stats, "hpack_recv_lithdr_incidx_v") diff --git a/tools/run_tests/performance/run_worker_php.sh b/tools/run_tests/performance/run_worker_php.sh index e524d5286d..8c7ceef2ff 100755 --- a/tools/run_tests/performance/run_worker_php.sh +++ b/tools/run_tests/performance/run_worker_php.sh @@ -17,17 +17,7 @@ source ~/.rvm/scripts/rvm set -ex cd $(dirname $0)/../../.. -repo=$(pwd) -# First set up all dependences needed for PHP QPS test -cd $repo -cd src/php/tests/qps -composer install -# Install protobuf C-extension for php -cd vendor/google/protobuf/php/ext/google/protobuf -phpize -./configure -make + # The proxy worker for PHP is implemented in Ruby -cd $repo ruby src/ruby/qps/proxy-worker.rb $@ diff --git a/tools/run_tests/performance/scenario_config.py b/tools/run_tests/performance/scenario_config.py index 6c81420be3..50ca0ee3ae 100644 --- a/tools/run_tests/performance/scenario_config.py +++ b/tools/run_tests/performance/scenario_config.py @@ -800,39 +800,54 @@ class RubyLanguage: return 'ruby' -class PhpLanguage: +class Php7Language: - def __init__(self, use_protobuf_c_extension=False): + def __init__(self, php7_protobuf_c=False): pass - self.use_protobuf_c_extension=use_protobuf_c_extension + self.php7_protobuf_c=php7_protobuf_c self.safename = str(self) def worker_cmdline(self): - if self.use_protobuf_c_extension: - return ['tools/run_tests/performance/run_worker_php.sh', '-c'] + if self.php7_protobuf_c: + return ['tools/run_tests/performance/run_worker_php.sh', '--use_protobuf_c_extension'] return ['tools/run_tests/performance/run_worker_php.sh'] def worker_port_offset(self): + if self.php7_protobuf_c: + return 900 return 800 def scenarios(self): - php_extension_mode='php_protobuf_php_extension' - if self.use_protobuf_c_extension: - php_extension_mode='php_protobuf_c_extension' + php7_extension_mode='php7_protobuf_php_extension' + if self.php7_protobuf_c: + php7_extension_mode='php7_protobuf_c_extension' yield _ping_pong_scenario( - '%s_to_cpp_protobuf_sync_unary_ping_pong' % php_extension_mode, + '%s_to_cpp_protobuf_sync_unary_ping_pong' % php7_extension_mode, rpc_type='UNARY', client_type='SYNC_CLIENT', server_type='SYNC_SERVER', server_language='c++', async_server_threads=1) yield _ping_pong_scenario( - '%s_to_cpp_protobuf_sync_streaming_ping_pong' % php_extension_mode, + '%s_to_cpp_protobuf_sync_streaming_ping_pong' % php7_extension_mode, rpc_type='STREAMING', client_type='SYNC_CLIENT', server_type='SYNC_SERVER', server_language='c++', async_server_threads=1) - def __str__(self): - return 'php' + # TODO(ddyihai): Investigate why when async_server_threads=1/CPU usage 340%, the QPS performs + # better than async_server_threads=0/CPU usage 490%. + yield _ping_pong_scenario( + '%s_to_cpp_protobuf_sync_unary_qps_unconstrained' % php7_extension_mode, + rpc_type='UNARY', client_type='SYNC_CLIENT', server_type='ASYNC_SERVER', + server_language='c++', outstanding=1, async_server_threads=1, unconstrained_client='sync') + yield _ping_pong_scenario( + '%s_to_cpp_protobuf_sync_streaming_qps_unconstrained' % php7_extension_mode, + rpc_type='STREAMING', client_type='SYNC_CLIENT', server_type='ASYNC_SERVER', + server_language='c++', outstanding=1, async_server_threads=1, unconstrained_client='sync') + + def __str__(self): + if self.php7_protobuf_c: + return 'php7_protobuf_c' + return 'php7' class JavaLanguage: @@ -1031,8 +1046,8 @@ LANGUAGES = { 'node' : NodeLanguage(), 'node_express': NodeExpressLanguage(), 'ruby' : RubyLanguage(), - 'php_protobuf_php' : PhpLanguage(), - 'php_protobuf_c' : PhpLanguage(use_protobuf_c_extension=True), + 'php7' : Php7Language(), + 'php7_protobuf_c' : Php7Language(php7_protobuf_c=True), 'java' : JavaLanguage(), 'python' : PythonLanguage(), 'go' : GoLanguage(), diff --git a/tools/run_tests/performance/scenario_result_schema.json b/tools/run_tests/performance/scenario_result_schema.json index 2f0fd916d4..169221d18c 100644 --- a/tools/run_tests/performance/scenario_result_schema.json +++ b/tools/run_tests/performance/scenario_result_schema.json @@ -382,6 +382,11 @@ }, { "mode": "NULLABLE", + "name": "core_http2_spurious_writes_begun", + "type": "INTEGER" + }, + { + "mode": "NULLABLE", "name": "core_hpack_recv_indexed", "type": "INTEGER" }, @@ -1174,6 +1179,11 @@ }, { "mode": "NULLABLE", + "name": "core_http2_spurious_writes_begun", + "type": "INTEGER" + }, + { + "mode": "NULLABLE", "name": "core_hpack_recv_indexed", "type": "INTEGER" }, |