I am running NGINX and Tomcat on Docker containers (container OS is Red Hat linux) and deployed through Kubernetes pods. Host OS is Red Hat Linux.
My query is which OS parameter will be effective – host OS or container OS? During performance tuning do I need to tune both OS or host OS parameters are effective. Example of some parameters I am referring to are ulimit – n (open files), net.ipv4.tcp.* , fs.file-max, etc.
Advertisement
Answer
As Crazykev already mentioned, you can set ulimits using the respective docker run
flags.
Parameters like net.ipv4.tcp.*
are kernel parameters. Docker containers are run in the same Linux kernel as the host system; for this reason, parameters set on the host will also be effective in the container.
Usually, you will not be able to set these parameters from inside a container. You can (not saying you should) start a container with the --privileged
flag, which might (untested) give you access to setting kernel parameters from within the container. The Kubernetes docs also describe how to start privileged containers.