-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
transport: server keepalives should be sent every [Time] period #3172
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good. Can you run a QPS style benchmark (many concurrent, small RPCs) for this and report the numbers? Thanks!
internal/transport/http2_server.go
Outdated
// acked). | ||
sleepDuration := minTime(t.kp.Time, kpTimeoutLeft) | ||
kpTimeoutLeft -= sleepDuration | ||
prevNano = lastRead |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I this case I think we know prevNano == lastRead
already (otherwise the first if
above would have skipped this), so this is unnecessary. Or lastRead
is going backwards which is 😮 .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Benchmark config::
Mode: Unary
BenchTime: 1m
MaxConcurrentCalls: 100
ReqSize: 1B
RespSize: 1B
Benchmark results::
Title Before After Percentage
TotalOps 2240700 2237780 -0.13%
SendOps 0 0 NaN%
RecvOps 0 0 NaN%
Bytes/op 8491.83 8492.49 0.01%
Allocs/op 161.22 161.28 0.00%
ReqT/op 298760.00 298370.67 -0.13%
RespT/op 298760.00 298370.67 -0.13%
50th-Lat 2.601787ms 2.619027ms 0.66%
90th-Lat 3.766543ms 3.750905ms -0.42%
99th-Lat 5.282168ms 5.185314ms -1.83%
Avg-Lat 2.676142ms 2.679648ms 0.13%
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you say lastRead
is going backwards?
Looks like I added this assignment in the client side PR because we wanted to avoid a crazy race. But thinking about it now, it looks like we don't need to make the assignment. I'm removing it here and in the client side.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you say lastRead is going backwards?
I didn't say it is. I said the only way we can reach this point is if lastRead
is either unchanged or going backwards. I assumed the latter wasn't possible, so lastRead == prevNano
and there's no need for this assignment.
This PR contains the server side changes corresponding to the client
side changes made in #3102.
Apart from the fix for the issue mentioned in
#2638, this PR also makes some
minor code cleanup and fixes the channelz test for keepalives count.