-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[nginx-ingress-controller] improve nginx performance #1379
Conversation
@bprashanth ping |
args: | ||
- -c | ||
- sysctl -w net.core.somaxconn=32768 | ||
&& sysctl -w net.ipv4.ip_local_port_range='1024 65535' |
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.
just make this a while true loop and you get free reconciliation?
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.
eg:
command:
- /bin/sh
- -c
- |
while true; do sysctl && sysctl; sleep 10; done
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.
done
- /bin/sh | ||
- -c | ||
- | | ||
while true; do sysctl -w net.core.somaxconn=32768 && sysctl -w net.ipv4.ip_local_port_range='1024 65535'; sleep 10; done |
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.
you can actually split this into lines now that you have the "|", for readability.
while true; do
sysctl stuff
done
Also aren't there a couple of other nice tcp level tunables? maybe we should consider a custom entrypoint script that people can extend?
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.
It would also be good to note down what are per ns sysctls vs shared between host and ns. I don't think any of the tcp tunables are per netns actually. I do think the ones in /sys/net/core are per net ns.
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.
done
- | | ||
while true; do | ||
sysctl -w net.core.somaxconn=32768 | ||
sysctl -w net.ipv4.ip_local_port_range='1024 65535' |
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.
what about backlog queue size? is that not per ns?
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.
what about backlog queue size? is that not per ns?
No
/ # sysctl -A | grep "net.core.netdev_max_backlog"
sysctl: error reading key 'net.ipv6.conf.all.stable_secret': I/O error
sysctl: error reading key 'net.ipv6.conf.default.stable_secret': I/O error
sysctl: error reading key 'net.ipv6.conf.eth0.stable_secret': I/O error
sysctl: error reading key 'net.ipv6.conf.lo.stable_secret': I/O error
/ #
LGTM |
# IPC Namespace: kernel.msgmax, kernel.msgmnb, kernel.msgmni, kernel.sem, kernel.shmall, | ||
# kernel.shmmax, kernel.shmmni, kernel.shm_rmid_forced and Sysctls | ||
# beginning with fs.mqueue.* | ||
# Network Namespace: Sysctls beginning with net.* |
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.
actually this is not true right? dont think fin timeout is per ns? or is it
Changing container
/proc
values with a privileged sidecar.NGINX reads
net.core.somaxconn
to increase the size of backlog queue of pending connections