From 310a5b9dcd0cd38d4f463e799343dc941fde7b1a Mon Sep 17 00:00:00 2001 From: Nicolas Noble Date: Wed, 8 Aug 2018 05:57:31 -0700 Subject: [PATCH 1/5] Create ssl-performance.md First draft --- doc/ssl-performance.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 doc/ssl-performance.md diff --git a/doc/ssl-performance.md b/doc/ssl-performance.md new file mode 100644 index 00000000000..5af7afdfe49 --- /dev/null +++ b/doc/ssl-performance.md @@ -0,0 +1,30 @@ +# SSL in gRPC and performance + +The SSL requirement of gRPC isn't necessarily making it easy to integrate. The HTTP/2 protocol requires ALPN support, which is a fairly new handshake protocol only supported by recent implementations. + +As a result, we've tried hard to provide a smooth experience to our users when compiling and distributing gRPC, but this may come at performance costs due to this. More specifically, we will sometime build the SSL library by disabling assembly code, which can impact performances by an order of magnitude when processing encrypted streams. + +Build system | Condition | Platform | Assembly code +---|---|---|-- +Makefile | with OpenSSL 1.0.2 development files | all | :heavy_check_mark: +Makefile | all other cases | all | :x: +Bazel | | Linux | :heavy_check_mark: +Bazel | | MacOS | :heavy_check_mark: +Bazel | | Windows | :x: +CMake | | Windows | :x: +CMake | | all others | :heavy_check_mark: + + +In addition, we are shipping packages for language implementations. These packages are source packages, but also have pre-built binaries being distributed. Building packages from source may give a different result in some cases. + +Language | From source | Platform | Assembly code +---|---|---|--- +Node.JS | n/a | Linux | :heavy_check_mark: +Node.JS | n/a | MacOS | :heavy_check_mark: +Node.JS | n/a | Windows | :x: +Electron | n/a | all | :heavy_check_mark: +Ruby | Yes | all | Same as the `Makefile` case from above +Ruby | No | all | :x: +PHP | Yes | all | Same as the `Makefile` case from above +PHP | No | all | :x: +Python | n/a | all | :x: From b60c1f10cd36e18fda9fd53248c7f4cf46e493e3 Mon Sep 17 00:00:00 2001 From: Nicolas Noble Date: Wed, 8 Aug 2018 08:54:52 -0700 Subject: [PATCH 2/5] Ruby always disables assembly. --- doc/ssl-performance.md | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/ssl-performance.md b/doc/ssl-performance.md index 5af7afdfe49..f0d2e0a0748 100644 --- a/doc/ssl-performance.md +++ b/doc/ssl-performance.md @@ -23,7 +23,6 @@ Node.JS | n/a | Linux | :heavy_check_mark: Node.JS | n/a | MacOS | :heavy_check_mark: Node.JS | n/a | Windows | :x: Electron | n/a | all | :heavy_check_mark: -Ruby | Yes | all | Same as the `Makefile` case from above Ruby | No | all | :x: PHP | Yes | all | Same as the `Makefile` case from above PHP | No | all | :x: From 7faa3fecad62580fd0a644bb814e1b488ef6248b Mon Sep 17 00:00:00 2001 From: Nicolas Noble Date: Wed, 8 Aug 2018 08:55:19 -0700 Subject: [PATCH 3/5] Update assembly code heading a bit. --- doc/ssl-performance.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/ssl-performance.md b/doc/ssl-performance.md index f0d2e0a0748..2604e26a808 100644 --- a/doc/ssl-performance.md +++ b/doc/ssl-performance.md @@ -4,7 +4,7 @@ The SSL requirement of gRPC isn't necessarily making it easy to integrate. The H As a result, we've tried hard to provide a smooth experience to our users when compiling and distributing gRPC, but this may come at performance costs due to this. More specifically, we will sometime build the SSL library by disabling assembly code, which can impact performances by an order of magnitude when processing encrypted streams. -Build system | Condition | Platform | Assembly code +Build system | Condition | Platform | Uses assembly code ---|---|---|-- Makefile | with OpenSSL 1.0.2 development files | all | :heavy_check_mark: Makefile | all other cases | all | :x: @@ -17,7 +17,7 @@ CMake | | all others | :heavy_check_mark: In addition, we are shipping packages for language implementations. These packages are source packages, but also have pre-built binaries being distributed. Building packages from source may give a different result in some cases. -Language | From source | Platform | Assembly code +Language | From source | Platform | Uses assembly code ---|---|---|--- Node.JS | n/a | Linux | :heavy_check_mark: Node.JS | n/a | MacOS | :heavy_check_mark: From 152c413224a73be89fe83f4de3adf5530566b331 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 10 Aug 2018 15:57:52 +0200 Subject: [PATCH 4/5] Improvements to ssl-performance.md --- doc/ssl-performance.md | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/doc/ssl-performance.md b/doc/ssl-performance.md index 2604e26a808..176c8d8f247 100644 --- a/doc/ssl-performance.md +++ b/doc/ssl-performance.md @@ -2,28 +2,35 @@ The SSL requirement of gRPC isn't necessarily making it easy to integrate. The HTTP/2 protocol requires ALPN support, which is a fairly new handshake protocol only supported by recent implementations. -As a result, we've tried hard to provide a smooth experience to our users when compiling and distributing gRPC, but this may come at performance costs due to this. More specifically, we will sometime build the SSL library by disabling assembly code, which can impact performances by an order of magnitude when processing encrypted streams. +As a result, we've tried hard to provide a smooth experience to our users when compiling and distributing gRPC, but this may come at performance costs due to this. More specifically, we will sometime build the SSL library by disabling assembly code +(by setting the `OPENSSL_NO_ASM` option), which can impact performance by an order of magnitude when processing encrypted streams. -Build system | Condition | Platform | Uses assembly code +## gRPC C++: Building from Source + +Build system | Condition | Platform | Uses assembly optimizations ---|---|---|-- Makefile | with OpenSSL 1.0.2 development files | all | :heavy_check_mark: Makefile | all other cases | all | :x: Bazel | | Linux | :heavy_check_mark: Bazel | | MacOS | :heavy_check_mark: Bazel | | Windows | :x: -CMake | | Windows | :x: -CMake | | all others | :heavy_check_mark: +CMake | boringssl from submodule (default) | all | :x: +CMake | pre-installed OpenSSL 1.0.2+ (`gRPC_SSL_PROVIDER=package`) | all | :heavy_check_mark: +## Other Languages: Binary/Source Packages In addition, we are shipping packages for language implementations. These packages are source packages, but also have pre-built binaries being distributed. Building packages from source may give a different result in some cases. -Language | From source | Platform | Uses assembly code +Language | From source | Platform | Uses assembly optimizations ---|---|---|--- +C# | n/a | all | :x: Node.JS | n/a | Linux | :heavy_check_mark: Node.JS | n/a | MacOS | :heavy_check_mark: Node.JS | n/a | Windows | :x: Electron | n/a | all | :heavy_check_mark: -Ruby | No | all | :x: +ObjC | Yes | iOS | :x: PHP | Yes | all | Same as the `Makefile` case from above PHP | No | all | :x: Python | n/a | all | :x: +Ruby | No | all | :x: + From 2583dc802a7e80ea87d77a06428196cdc81a6e6d Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 10 Aug 2018 16:11:52 +0200 Subject: [PATCH 5/5] regenerate doxygen --- tools/doxygen/Doxyfile.c++ | 1 + tools/doxygen/Doxyfile.c++.internal | 1 + tools/doxygen/Doxyfile.core | 1 + tools/doxygen/Doxyfile.core.internal | 1 + 4 files changed, 4 insertions(+) diff --git a/tools/doxygen/Doxyfile.c++ b/tools/doxygen/Doxyfile.c++ index 2f06bda0168..688c271feac 100644 --- a/tools/doxygen/Doxyfile.c++ +++ b/tools/doxygen/Doxyfile.c++ @@ -791,6 +791,7 @@ doc/server-reflection.md \ doc/server_reflection_tutorial.md \ doc/server_side_auth.md \ doc/service_config.md \ +doc/ssl-performance.md \ doc/status_ordering.md \ doc/statuscodes.md \ doc/unit_testing.md \ diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index a46ebe61976..592b0b20e65 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -791,6 +791,7 @@ doc/server-reflection.md \ doc/server_reflection_tutorial.md \ doc/server_side_auth.md \ doc/service_config.md \ +doc/ssl-performance.md \ doc/status_ordering.md \ doc/statuscodes.md \ doc/unit_testing.md \ diff --git a/tools/doxygen/Doxyfile.core b/tools/doxygen/Doxyfile.core index 4899eee3ea4..aa75bc68283 100644 --- a/tools/doxygen/Doxyfile.core +++ b/tools/doxygen/Doxyfile.core @@ -793,6 +793,7 @@ doc/server-reflection.md \ doc/server_reflection_tutorial.md \ doc/server_side_auth.md \ doc/service_config.md \ +doc/ssl-performance.md \ doc/status_ordering.md \ doc/statuscodes.md \ doc/unit_testing.md \ diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index 18f56984fe2..6a6991ec508 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -793,6 +793,7 @@ doc/server-reflection.md \ doc/server_reflection_tutorial.md \ doc/server_side_auth.md \ doc/service_config.md \ +doc/ssl-performance.md \ doc/status_ordering.md \ doc/statuscodes.md \ doc/unit_testing.md \