summaryrefslogtreecommitdiffhomepage
path: root/pkg
diff options
context:
space:
mode:
authorFabricio Voznika <fvoznika@google.com>2018-08-08 10:24:53 -0700
committerShentubot <shentubot@google.com>2018-08-08 10:26:18 -0700
commit0d350aac7f70487bc28bae0d0f457155a4e19081 (patch)
treee4397f3cb6e28045f57ca3eacf4c873331f50328 /pkg
parentcb23232c37c092b60d7e3ee91cb8dd8bed855028 (diff)
Enable SACK in runsc
SACK is disabled by default and needs to be manually enabled. It not only improves performance, but also fixes hangs downloading files from certain websites. PiperOrigin-RevId: 207906742 Change-Id: I4fb7277b67bfdf83ac8195f1b9c38265a0d51e8b
Diffstat (limited to 'pkg')
-rw-r--r--pkg/sentry/socket/hostinet/stack.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/pkg/sentry/socket/hostinet/stack.go b/pkg/sentry/socket/hostinet/stack.go
index 44c3b9a3f..f64809d39 100644
--- a/pkg/sentry/socket/hostinet/stack.go
+++ b/pkg/sentry/socket/hostinet/stack.go
@@ -84,11 +84,13 @@ func (s *Stack) Configure() error {
log.Warningf("Failed to read TCP send buffer size, using default values")
}
- s.tcpSACKEnabled = false
+ // SACK is important for performance and even compatibility, assume it's
+ // enabled if we can't find the actual value.
+ s.tcpSACKEnabled = true
if sack, err := ioutil.ReadFile("/proc/sys/net/ipv4/tcp_sack"); err == nil {
s.tcpSACKEnabled = strings.TrimSpace(string(sack)) != "0"
} else {
- log.Warningf("Failed to read if TCP SACK if enabled, setting to false")
+ log.Warningf("Failed to read if TCP SACK if enabled, setting to true")
}
return nil