How do you set net.core.somaxconn in the docker container?

How do you set net.core.somaxconn in the docker container so that Redis doesn’t complain that somaxconn is less than 511? Using sysctl doesnt work inside of the container and setting it on the host doesn’t affect the container. Perhaps the launcher script should know to run docker with the --sysctl net.core.somaxconn=512 option?

1 Like
2 Likes

What’s that supposed to mean: that ignoring the warning will blow up your site? Or that the warning is a joke?

PS Sarcasm doesn’t transfer over TCP/IP :slight_smile:

Can we ever truly know what anything means, really?

What I meant was that you can ignore the warning, it’s just Redis being finicky.

4 Likes

I have found the solution:

./launcher rebuild <container> --docker-args "--sysctl net.core.somaxconn=65535"

https://github.com/discourse/discourse_docker/blob/e9505520/launcher#L18-L18

«docker run» → «Configure namespaced kernel parameters (sysctls) at runtime»

5 Likes

I noticed the following warning in my rebuild log:

# WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.

I was doing some reading and found some suggestions to raise this value. Should I? Will this help performance of our platform?

2 Likes

Thanks for moving my post to the right topic guys, it was kinda hard to find as the keyword appears in many search results :vulcan_salute:

So there’s no apparent advantage to tweaking this value? That’s one thing off my todo list then!

2 Likes