From a8608c501b23f89ac3df50cde7428cb3c4b56145 Mon Sep 17 00:00:00 2001 From: Bhasker Hariharan Date: Fri, 14 Jun 2019 07:30:30 -0700 Subject: Enable Receive Buffer Auto-Tuning for runsc. Updates #230 PiperOrigin-RevId: 253225078 --- runsc/boot/loader.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/runsc/boot/loader.go b/runsc/boot/loader.go index 53e61e43d..41027416d 100644 --- a/runsc/boot/loader.go +++ b/runsc/boot/loader.go @@ -847,9 +847,17 @@ func newEmptyNetworkStack(conf *Config, clock tcpip.Clock) (inet.Stack, error) { // privileges. Raw: true, })} + + // Enable SACK Recovery. if err := s.Stack.SetTransportProtocolOption(tcp.ProtocolNumber, tcp.SACKEnabled(true)); err != nil { return nil, fmt.Errorf("failed to enable SACK: %v", err) } + + // Enable Receive Buffer Auto-Tuning. + if err := s.Stack.SetTransportProtocolOption(tcp.ProtocolNumber, tcpip.ModerateReceiveBufferOption(true)); err != nil { + return nil, fmt.Errorf("SetTransportProtocolOption failed: %v", err) + } + return &s, nil default: -- cgit v1.2.3