1

I set net.core.somaxconn = 65535 in /etc/sysctl.conf inside an Ubuntu image.

But the net.core.somaxconn turns to 128 in the container using command sysctl -a | grep net.core.somaxconn.

After I execute sysctl -p, it turns to 65535.

Why doesn't /etc/sysctl.conf work when running a container (Docker 0.9) ?

lucian.pantelimon
  • 3,673
  • 4
  • 29
  • 46
Tallmad
  • 1,951
  • 4
  • 22
  • 29

1 Answers1

1

This is probably the case because Docker does not run sysctl for you. I don't know how you start your container, but if you do something like docker run -i -t image /bin/bash it only starts bash. There is no upstart kicked of or anything, so if you decide running sysctl is important, you need to do that yourself.

For development purposes, you can use

docker run -i -t image sysctl -p && /bin/bash

For production use, you might want to take a look at supervisor or at my blog on that.

qkrijger
  • 26,686
  • 6
  • 36
  • 37