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

fix(grpc): fix framer in loopyWriter for flush in time #406

Merged
merged 1 commit into from Apr 20, 2022

Conversation

SinnerA
Copy link
Contributor

@SinnerA SinnerA commented Apr 15, 2022

What type of PR is this?

fix

What this PR does / why we need it (English/Chinese):

zh:
修复 http2 framer 的读写逻辑,例如避免对端无法及时收到 framer

下面是带来的副作用:

  1. 减少了 loopywriter 的 flush 次数,提升了吞吐
  2. 用原生的 net/http2 替换了原本的 nhttp2
  3. client 和 server 都新增 WithGRPCWriteBufferSize 和 WithGRPCReadBufferSize 两个 option

en:
Fix the sending and receiving logic about http2 framer, such as preventing the peer unable receive framer in time

Bring some side effects:

  1. Reduce the flush frequency in the loopywriter, thereby increasing the throughput
  2. Replace the dependence nhttp2 with built-in net/http2
  3. Client and Server both provide two options, WithGRPCWriteBufferSize, and WithGRPCReadBufferSize

Which issue(s) this PR fixes:

joway
joway previously approved these changes Apr 15, 2022
@SinnerA SinnerA force-pushed the fix/fix_framer_rw_without_nhttp2 branch 2 times, most recently from 84fbb14 to e3b11ec Compare April 15, 2022 04:06
joway
joway previously approved these changes Apr 18, 2022
go.sum Outdated Show resolved Hide resolved
@SinnerA SinnerA force-pushed the fix/fix_framer_rw_without_nhttp2 branch from 56354c0 to 661e66b Compare April 20, 2022 07:23
@SinnerA SinnerA changed the title Fix/fix framer rw without nhttp2 fix: fix framer rw without nhttp2 Apr 20, 2022
@SinnerA SinnerA changed the title fix: fix framer rw without nhttp2 fix: fix framer in loopyWriter for flush in time Apr 20, 2022
@YangruiEmma YangruiEmma changed the title fix: fix framer in loopyWriter for flush in time fix(grpc): fix framer in loopyWriter for flush in time Apr 20, 2022
@SinnerA SinnerA merged commit 6c033d9 into cloudwego:develop Apr 20, 2022
@YangruiEmma YangruiEmma added this to the v0.3.0 milestone Apr 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants