Linked Questions

Popular Questions

tcp_keepalive_time in docker container

Asked by At

I have a docker host that has set a net.ipv4.tcp_keepalive_time kernel parameter to 600. But when a container runs, it uses a different value:

$ sysctl net.ipv4.tcp_keepalive_time
net.ipv4.tcp_keepalive_time = 600

$ docker run --rm ubuntu:latest sysctl net.ipv4.tcp_keepalive_time
net.ipv4.tcp_keepalive_time = 7200

Why is this and how can I change this value without having to pass --sysctl option?

The reason I cannot pass --sysctl in my case is that this host is a docker swarm container and this option is currently unsupported in swarm.

But shouldn't containers just take these kernel parameters from the host? I already restarted the docker service (and its containers).

edit: some extra host info:

$ uname -r
4.15.0-38-generic
$ docker --version
Docker version 18.06.1-ce, build e68fc7a

Related Questions