aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/csharp/server_reflection.md3
-rw-r--r--doc/python/server_reflection.md61
-rw-r--r--doc/server-reflection.md2
-rw-r--r--doc/ssl-performance.md36
4 files changed, 100 insertions, 2 deletions
diff --git a/doc/csharp/server_reflection.md b/doc/csharp/server_reflection.md
index 9721680269..7827cbb21f 100644
--- a/doc/csharp/server_reflection.md
+++ b/doc/csharp/server_reflection.md
@@ -30,7 +30,8 @@ server.Start();
```
After starting the server, you can verify that the server reflection
-is working properly by using the `grpc_cli` command line tool:
+is working properly by using the [`grpc_cli` command line
+tool](https://github.com/grpc/grpc/blob/master/doc/command_line_tool.md):
```sh
$ grpc_cli ls localhost:50051
diff --git a/doc/python/server_reflection.md b/doc/python/server_reflection.md
new file mode 100644
index 0000000000..5a68e3c301
--- /dev/null
+++ b/doc/python/server_reflection.md
@@ -0,0 +1,61 @@
+# gRPC Python Server Reflection
+
+This document shows how to use gRPC Server Reflection in gRPC Python.
+Please see [C++ Server Reflection Tutorial](../server_reflection_tutorial.md)
+for general information and more examples how to use server reflection.
+
+## Enable server reflection in Python servers
+
+gRPC Python Server Reflection is an add-on library.
+To use it, first install the [grpcio-reflection](https://pypi.org/project/grpcio-reflection/)
+PyPI package into your project.
+
+Note that with Python you need to manually register the service
+descriptors with the reflection service implementation when creating a server
+(this isn't necessary with e.g. C++ or Java)
+```python
+# add the following import statement to use server reflection
+from grpc_reflection.v1alpha import reflection
+# ...
+def serve():
+ server = grpc.server(futures.ThreadPoolExecutor(max_workers=10))
+ helloworld_pb2_grpc.add_GreeterServicer_to_server(Greeter(), server)
+ # the reflection service will be aware of "Greeter" and "ServerReflection" services.
+ SERVICE_NAMES = (
+ helloworld_pb2.DESCRIPTOR.services_by_name['Greeter'].full_name,
+ reflection.SERVICE_NAME,
+ )
+ reflection.enable_server_reflection(SERVICE_NAMES, server)
+ server.add_insecure_port('[::]:50051')
+ server.start()
+```
+
+Please see
+[greeter_server_with_reflection.py](https://github.com/grpc/grpc/blob/master/examples/python/helloworld/greeter_server_with_reflection.py)
+in the examples directory for the full example, which extends the gRPC [Python
+`Greeter` example](https://github.com/grpc/tree/master/examples/python/helloworld) on a
+reflection-enabled server.
+
+After starting the server, you can verify that the server reflection
+is working properly by using the [`grpc_cli` command line
+tool](https://github.com/grpc/grpc/blob/master/doc/command_line_tool.md):
+
+ ```sh
+ $ grpc_cli ls localhost:50051
+ ```
+
+ output:
+ ```sh
+ grpc.reflection.v1alpha.ServerReflection
+ helloworld.Greeter
+ ```
+
+ For more examples and instructions how to use the `grpc_cli` tool,
+ please refer to the [`grpc_cli` documentation](../command_line_tool.md)
+ and the [C++ Server Reflection Tutorial](../server_reflection_tutorial.md).
+
+## Additional Resources
+
+The [Server Reflection Protocol](../server-reflection.md) provides detailed
+information about how the server reflection works and describes the server reflection
+protocol in detail.
diff --git a/doc/server-reflection.md b/doc/server-reflection.md
index c9b476599f..3716dc5a21 100644
--- a/doc/server-reflection.md
+++ b/doc/server-reflection.md
@@ -191,6 +191,6 @@ each language:
- [Go](https://github.com/grpc/grpc-go/blob/master/Documentation/server-reflection-tutorial.md#enable-server-reflection)
- [C++](https://grpc.io/grpc/cpp/md_doc_server_reflection_tutorial.html)
- [C#](https://github.com/grpc/grpc/blob/master/doc/csharp/server_reflection.md)
-- Python: (tutorial not yet written)
+- [Python](https://github.com/grpc/grpc/blob/master/doc/python/server_reflection.md)
- Ruby: not yet implemented [#2567](https://github.com/grpc/grpc/issues/2567)
- Node: not yet implemented [#2568](https://github.com/grpc/grpc/issues/2568)
diff --git a/doc/ssl-performance.md b/doc/ssl-performance.md
new file mode 100644
index 0000000000..176c8d8f24
--- /dev/null
+++ b/doc/ssl-performance.md
@@ -0,0 +1,36 @@
+# 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
+(by setting the `OPENSSL_NO_ASM` option), which can impact performance by an order of magnitude when processing encrypted streams.
+
+## 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 | 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 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:
+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:
+