Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 72bcc4c

Browse files
committedJun 25, 2021
Decrease default values for net.ipv4.tcp_rmem and net.ipv4.tcp_wmem
1 parent 76b0b6a commit 72bcc4c

File tree

119 files changed

+578
-144
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+578
-144
lines changed
 

Diff for: ‎nodeup/pkg/model/sysctls.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ func (b *SysctlBuilder) Build(c *fi.ModelBuilderContext) error {
7777
"",
7878

7979
"# Increase the maximum total buffer-space allocatable",
80-
"net.ipv4.tcp_wmem = 4096 12582912 16777216",
81-
"net.ipv4.tcp_rmem = 4096 12582912 16777216",
80+
"net.ipv4.tcp_wmem = 4096 87380 16777216",
81+
"net.ipv4.tcp_rmem = 4096 87380 16777216",
8282
"",
8383

8484
"# Increase the number of outstanding syn requests allowed",

Diff for: ‎pkg/model/bootstrapscript.go

+12-1
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ func (b *BootstrapScript) Run(c *fi.Context) error {
390390
"SetSysctls": func() string {
391391
// By setting some sysctls early, we avoid broken configurations that prevent nodeup download.
392392
// See https://github.com/kubernetes/kops/issues/10206 for details.
393-
return "sysctl -w net.ipv4.tcp_rmem='4096 12582912 16777216' || true\n"
393+
return setSysctls()
394394
},
395395
}
396396

@@ -477,3 +477,14 @@ func gzipBase64(data string) (string, error) {
477477

478478
return base64.StdEncoding.EncodeToString(b.Bytes()), nil
479479
}
480+
481+
func setSysctls() string {
482+
var b bytes.Buffer
483+
484+
b.WriteString("sysctl -w net.core.rmem_max=16777216 || true\n")
485+
b.WriteString("sysctl -w net.core.wmem_max=16777216 || true\n")
486+
b.WriteString("sysctl -w net.ipv4.tcp_rmem='4096 87380 16777216' || true\n")
487+
b.WriteString("sysctl -w net.ipv4.tcp_wmem='4096 87380 16777216' || true\n")
488+
489+
return b.String()
490+
}

0 commit comments

Comments
 (0)
Please sign in to comment.