Skip to content

typo #176

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

typo #176

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
4 changes: 2 additions & 2 deletions grpc_client_pool.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

### golang grpc client锁竞争问题?

我在以前的文章中有描述过,golang标准库net/http由于单个连接池的限制会引起吞吐不足的问题。怎么个不足?就是cpu吃不满。这个是跟grpc有同样的表现,grpc在48个cup core的硬件环境下,在单客连接并发200的时候,只能跑到600%左右。再高的并发数只是增加了cpu消耗,grpc qps是没有提升。
我在以前的文章中有描述过,golang标准库net/http由于单个连接池的限制会引起吞吐不足的问题。怎么个不足?就是cpu吃不满。这个是跟grpc有同样的表现,grpc在48个cpu core的硬件环境下,在单客连接并发200的时候,只能跑到600%左右。再高的并发数只是增加了cpu消耗,grpc qps是没有提升。

为什么net/http的吞吐性能不足? 主要有两个点.

Expand Down Expand Up @@ -132,4 +132,4 @@ multi client: 100, qps is 359081

grpc复用http2协议是个好事,这样能让grpc有高度的兼容性,但是相比thrift来说性能是差点意思。毕竟grpc相对于thrift来说,需要unpack两次数据包,一次是header,一次是protobuf body。但话又说回来,相比性能,grpc有更活跃的社区支持和兼容性。

像istio的envoy sidecar本就支持http2,那么自然就很容易支持grpc。而像小米为了解决kubernets istio的联合,改了不少istio的控制面板代码来支持thrift协议。
像istio的envoy sidecar本就支持http2,那么自然就很容易支持grpc。而像小米为了解决kubernets istio的联合,改了不少istio的控制面板代码来支持thrift协议。