Skip to content
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

Gateway can cause Linux Kernel "TCP: Out of Memory" issue #26

Open
erulabs opened this issue Dec 10, 2021 · 0 comments
Open

Gateway can cause Linux Kernel "TCP: Out of Memory" issue #26

erulabs opened this issue Dec 10, 2021 · 0 comments
Assignees
Labels
Gateway Concerns the kubesail gateway (not the agent) portion of the codebase

Comments

@erulabs
Copy link
Contributor

erulabs commented Dec 10, 2021

KubeSail Gateway can occasionally buffer too much memory in TCP sockets to packet-lossy or mis-behaving connected agents.

A real fix would be to update gateway handleSocket() to keep a highwaterMark for buffered packets (or rather, to track it), and pause the incoming socket when the destination socket is queuing.

Until then, a temporary fix is to dramatically increase the TCP buffer size in the linux kernel of Gateway servers:

net.core.netdev_max_backlog=30000
net.core.rmem_max=134217728
net.core.wmem_max=134217728
net.ipv4.tcp_max_syn_backlog=8192
net.ipv4.tcp_rmem=4096 87380 67108864
net.ipv4.tcp_wmem=4096 87380 67108864

Note that kubesail-agent users don't need to worry about any of this!

@erulabs erulabs added the Gateway Concerns the kubesail gateway (not the agent) portion of the codebase label Dec 10, 2021
@erulabs erulabs self-assigned this Dec 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Gateway Concerns the kubesail gateway (not the agent) portion of the codebase
Projects
None yet
Development

No branches or pull requests

1 participant