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

AI-generated summary

Setting net.core.somaxconn in a Docker Container

The discussion revolves around setting the net.core.somaxconn value in a Docker container to prevent Redis warnings. Initially, squidboylan asks how to set this value, as using sysctl inside the container doesn’t work and setting it on the host doesn’t affect the container.

dmitry_fedyuk provides a solution by rebuilding the container with the --docker-args "--sysctl net.core.somaxconn=65535" option.

Later, bartv shares a warning message related to the somaxconn value and asks if raising this value can improve platform performance. However, after moving the discussion to the correct topic, bartv concludes that there’s no apparent advantage to tweaking this value, based on the conversation.

The discussion also includes a brief mention of a YouTube video by mpalmer, but its relevance is questioned by smaffulli. mpalmer clarifies that the warning can be ignored, as Redis is being finicky.

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?

2 „Gefällt mir“

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.

I have found the solution:

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

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

02

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?

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!