Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: Update all docs #18

Merged
merged 1 commit into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ English | [中文](README.zh_CN.md)
* [http upload/download service](./en/http_protocol_upload_download_service.md)
* [grpc service](./en/grpc_protocol_service.md)
* [grpc stream service](./en/grpc_protocol_streaming_service.md)
* [flatbuffers service](docs/en/xxx.md)
* [flatbuffers service](docs/en/flatbuffers_protocol_service.md)
* Client
* [guidelines](./en/client_guide.md)
* [access trpc service](./en/client_guide.md)
Expand All @@ -27,11 +27,11 @@ English | [中文](README.zh_CN.md)
* [access http upload/download service](./en/http_protocol_upload_download_client.md)
* [access grpc service](./en/grpc_protocol_client.md)
* [access grpc stream service](./en/grpc_protocol_streaming_service.md)
* [access flatbuffers service](docs/en/xxx.md)
* [access flatbuffers service](docs/en/flatbuffers_protocol_client.md)
* [access redis service](./en/redis_client_guide.md)
* Fiber
* [deep in fiber](./en/fiber.md)
* [fiber user guide](./en/fiber_user_guide.md)
* [fiber user guide](./en/fiber_user_guide.md)
* [fiber faq](./en/fiber_faq.md)
* [Future/Promise](./en/future_promise_guide.md)
* [Plugin](./en/plugin_management.md)
Expand Down
11 changes: 5 additions & 6 deletions docs/README.zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,19 @@
* [开发http上传/下载服务](./zh/http_protocol_upload_download_service.md)
* [开发grpc协议服务](./zh/grpc_protocol_service.md)
* [开发grpc流式服务](./zh/grpc_protocol_streaming_service.md)
* [开发flatbuffers协议服务](docs/en/xxx.md)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

xxx.md改成真实的

* [开发flatbuffers协议服务](docs/zh/flatbuffers_protocol_service.md)
* 客户端开发
* [开发向导](./zh/client_guide.md)
* [访问trpc协议服务](./zh/client_guide.md)
* [访问trpc流式协议服务](./zh/trpc_protocol_streaming_client.md)
* [访问http(s)协议服务](./zh/http_protocol_client.md)
* [访问http上传/下载服务](./zh/http_protocol_upload_download_client.md)
* [访问grpc协议服务](./zh/grpc_protocol_client.md)
* [访问grpc流式协议服务](./zh/grpc_protocol_streaming_service.md)
* [访问flatbuffers协议服务](./zh/flatbuffers_protocol_service.md)
* [访问flatbuffers协议服务](./zh/flatbuffers_protocol_client.md)
* [访问redis协议服务](./zh/redis_client_guide.md)
* Fiber
* [深入理解Fiber](./zh/fiber.md)
* [Fiber用户开发指南](./zh/fiber_user_guide.md)
* [Fiber用户开发指南](./zh/fiber_user_guide.md)
* [Fiber常见问题](./zh/fiber_faq.md)
* [Future/Promise](./zh/future_promise_guide.md)
* [插件](./zh/plugin_management.md)
Expand All @@ -40,7 +39,7 @@
* 拦截器
* [开发自定义拦截器](./zh/filter.md)
* 流控和过载保护
* []()
* [基于并发请求的过载保护](./zh/overload_control_concurrency_limiter.md)
* Naming插件
* [开发自定义naming插件](./zh/custom_naming.md)
* [mesh-polaris](https://github.com/trpc-ecosystem/cpp-naming-polarismesh/blob/main/README.zh_CN.md)
Expand Down Expand Up @@ -71,4 +70,4 @@
* [tvar](./zh/tvar.md)
* [admin](./zh/admin_service.md)
* [runtime info]()
* Faqs
* Faqs
14 changes: 7 additions & 7 deletions docs/en/admin_service.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ Usage:
3. Invoke the command

```shell
$ curl http://admin_ip:admin_port/cmds/reload-config -X POST
curl http://admin_ip:admin_port/cmds/reload-config -X POST
{"errorcode":0,"message":"reload config ok"}
```

Expand All @@ -213,7 +213,7 @@ server:
Example:

```shell
$ curl http://dmin_ip:admin_port/cmds/stats
curl http://dmin_ip:admin_port/cmds/stats
{"errorcode":0,"message":"","stats":{"conn_count":1,"total_req_count":11,"req_concurrency":1,"now_req_count":3,"last_req_count":4,"total_failed_req_count":0,"now_failed_req_count":0,"last_failed_req_count":0,"total_avg_delay":0.18181818181818183,"now_avg_delay":0.3333333333333333,"last_avg_delay":0.25,"max_delay":1,"last_max_delay":1}}
```

Expand Down Expand Up @@ -246,7 +246,7 @@ Interface description: You can directly access "/cmds/var" to view all tvar vari
Example:

```shell
$ curl http://127.0.0.1:8889/cmds/var
curl http://127.0.0.1:8889/cmds/var
{
"trpc" :
{
Expand Down Expand Up @@ -406,14 +406,14 @@ Usage:
1. Start sampling

```shell
$ curl http://admin_ip:admin_port/cmds/profile/heap?enable=y -X POST
curl http://admin_ip:admin_port/cmds/profile/heap?enable=y -X POST
{"errorcode":0,"message":"OK"}
```

2. Stop sampling

```shell
$ curl http://admin_ip:admin_port/cmds/profile/heap?enable=n -X POST
curl http://admin_ip:admin_port/cmds/profile/heap?enable=n -X POST
{"errorcode":0,"message":"OK"}
```

Expand Down Expand Up @@ -462,7 +462,7 @@ $ curl http://admin_ip:admin_port/client_detach -X POST -d 'service_name=trpc.ap
{"message":"service is not exist"}
```

# Customize management commands
# Custom management commands

The tRPC-Cpp allows users to customize and register management commands to perform additional management operations as needed by the user. For specific usage examples, please refer to the [admin example](../../examples/features/admin/proxy/).

Expand Down Expand Up @@ -551,6 +551,6 @@ Usage:
After the service is started, you can trigger the custom management command by accessing `http://admin_ip:admin_port/myhandler`.

```shell
$ curl http://admin_ip:admin_port/myhandler
curl http://admin_ip:admin_port/myhandler
{"errorcode":0,"message":"success"}
```
2 changes: 1 addition & 1 deletion docs/en/architecture_design.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ The service exit process generally includes the following processes:

## Pluggable design

The pluggable architecture design of tRPC is based on "**plugin factory based on interface mechanism**" and "**filter based on AOP**".
The pluggable architecture design of tRPC is based on **plugin factory based on interface mechanism** and **filter based on AOP**.

### Plugin factory

Expand Down
3 changes: 2 additions & 1 deletion docs/en/attachment.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class ServerContext {

/// @brief Set response attachment data
void SetResponseAttachment(NoncontiguousBuffer&& attachment);
...

// ...
}
```
13 changes: 8 additions & 5 deletions docs/en/backup_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
# Overview

Sometimes, to ensure availability or reduce tail latency, it is necessary to simultaneously access two services and take the response from whichever arrives first. There are generally two approaches to implementing this functionality:

1. Concurrently send two requests and take the result from the one that returns first.
2. Set a reasonable resend time. If a request times out or fails
2. Set a reasonable resend time. If a request times out or fails
within the resend time, send the second request and take the result from the one that returns first.

One issue with approach 1 is that it doubles the backend traffic. Approach 2, on the other hand, typically results in only one request under normal circumstances, keeping the backend traffic mostly unchanged. Considering this, we chooses to implement approach 2.
Expand Down Expand Up @@ -91,10 +92,12 @@ If the strategy of the 'retry_hedging_limit' retry rate limiting filter does not
## View the triggering results of backup requests

The framework provides two tvar variables related to backup requests internally (where service_name is the name of the called service):
"trpc/client/service_name/backup_request" —— indicate how many times the backup request has been triggered
"trpc/client/service_name/backup_request_success" —— represent the number of times the backup request has resulted in a successful invocation

- trpc/client/service_name/backup_request: indicate how many times the backup request has been triggered
- trpc/client/service_name/backup_request_success: represent the number of times the backup request has resulted in a successful invocation

These two variables can be viewed using management commands:

```shell
curl http://admin_ip:admin_port/cmds/var/xxx # xxx represent tvar variables
```
Expand All @@ -105,6 +108,6 @@ It also supports reporting attribute monitoring to the corresponding platform.

1. Interface idempotence: Users need to ensure that the RPC calls they use are idempotent across different nodes.
2. Before enabling backup requests, it is important to ensure that the backend service has sufficient processing capacity to avoid triggering a service avalanche when backup requests are made.
3. It is necessary to select an appropriate resend time to reduce call latency while avoiding excessive traffic impact on the backend service. Usually, metrics such as P90/P95/P99 can be used as a basis for selection.
3. It is necessary to select an appropriate resend time to reduce call latency while avoiding excessive traffic impact on the backend service. Usually, metrics such as P90/P95/P99 latency can be used as a basis for selection.
4. Backup requests are not suitable for UDP, one-way calls, or streaming calls.
5. If there is only one available node in the backend service or the set resend time is greater than the request timeout, the backup request will degrade into a normal one-to-one call.
5. If there is only one available node in the backend service or the set resend time is greater than the request timeout, the backup request will degrade into a normal one-to-one call.
Loading