-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
use SO_RCVBUFFORCE to force receive buffer increase on Linux #3804
Conversation
@@ -17,3 +22,23 @@ const ( | |||
) | |||
|
|||
const batchSize = 8 // needs to smaller than MaxUint8 (otherwise the type of oobConn.readPos has to be changed) | |||
|
|||
func forceSetReceiveBuffer(c interface{}, bytes int) error { |
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.
There's no downside to always calling SO_RCVBUFFORCE, is there?
If that's the case, you could just do it as part of setReceiveBuffer
, no?
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.
A couple a reasons to keep it here:
unix.SO_RCVBUFFORCE
is only defined for GOOS=linux. So this would fail if we put it insetReceiveBuffer
as is, since that's shared.- Having it as a separate function lets us test only this thing. However, I'm not sure this will actually work since CI runner might not have CAP_NET_ADMIN (I don't when running this as a normal user).
854bd99
to
a85cc72
Compare
a85cc72
to
b7f7f78
Compare
Codecov Report
@@ Coverage Diff @@
## master #3804 +/- ##
==========================================
+ Coverage 83.97% 84.14% +0.17%
==========================================
Files 142 141 -1
Lines 14208 14000 -208
==========================================
- Hits 11930 11779 -151
+ Misses 1846 1795 -51
+ Partials 432 426 -6
|
9b08488
to
4644cb9
Compare
4644cb9
to
103e683
Compare
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.
Thank you for working on this @MarcoPolo!
One minor change was still needed: We need to ignore the error from SetReadBuffer
. Other than that, I modified the CI setup a bit, so that we can test this (it's even included in Codecov, which is pretty cool).
Merging this now, since I need to build on top of it to increase the send buffer as well (#3811), and this is blocking progress on the GSO PR. |
Closes #3795