-
Notifications
You must be signed in to change notification settings - Fork 198
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
Using cmux with MatchWithWriters
consumes too much CPU
#42
Comments
ping @soheilhy |
Please attach a pprof callgraph and I'll take a look. |
I have the same problem on latest master branch: |
I'm not aware of any new issues. Do you have a profile or a call graph? |
Not now. I will try to create a PoC. |
@soheilhy Perhaps when you send empty settings the clients can't handle that correctly, one can see that when debugging the server with GODEBUG=http2debug=2
Both client and server are in go, the grpc-gateway is actually creating a local connection to the server so when it translates REST API calls the code call gRPC endpoint locally. |
I think you've found the bug. Thank you. Can you give the following patch a try? I think it should fix the issue. |
@soheilhy That solves it. |
Great thank you for the confirmation. |
I'm going to mark this bug as fixed. Please open if it flares up again. |
We are using cmux with gRPC and grpc-gateway like this example. . But we found out that using
grpcl := m.MatchWithWriters(cmux.HTTP2MatchHeaderFieldSendSettings("content-type", "application/grpc"))
consumes too much cpu.$ ~> ps axo pid,etime,%cpu,%mem,cmd | grep 'server-combine' | grep -v grep 7054 00:07 123 0.1 server-combine
Using
m.Match(cmux.HTTP2HeaderField("content-type", "application/grpc"))
is ok. but if try to use the L28 this takes too much CPU.Is there any fix for this?
The text was updated successfully, but these errors were encountered: