Skip to content
This repository has been archived by the owner on Apr 17, 2019. It is now read-only.

[nginx-ingress-controller] improve nginx performance #1379

Merged
merged 1 commit into from
Jul 20, 2016

Conversation

aledbf
Copy link
Contributor

@aledbf aledbf commented Jul 16, 2016

Changing container /proc values with a privileged sidecar.
NGINX reads net.core.somaxconn to increase the size of backlog queue of pending connections

@aledbf
Copy link
Contributor Author

aledbf commented Jul 16, 2016

@bprashanth ping

args:
- -c
- sysctl -w net.core.somaxconn=32768
&& sysctl -w net.ipv4.ip_local_port_range='1024 65535'

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?

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

Copy link
Contributor Author

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

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?

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.

Copy link
Contributor Author

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'

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?

Copy link
Contributor Author

@aledbf aledbf Jul 20, 2016

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
/ #

@bprashanth
Copy link

LGTM

@bprashanth bprashanth merged commit 182a610 into kubernetes-retired:master Jul 20, 2016
@aledbf aledbf deleted the tune-proc branch July 20, 2016 20:17
# 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.*

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants