Francis
Francis

Reputation: 289

Increase PIDs of Ghost Docker

I’m using Ghost Blog by Docker, but my site is too much user access. When I view stats of containers, Ghost just serves 10 pids, not more.

So, how can I increase more pids in ghost docker containers?

Upvotes: 0

Views: 965

Answers (1)

Paul Rey
Paul Rey

Reputation: 1337

I will answer to your question "how to increase PIDs in Docker" but I don't think your issue come from this limitation.

If you want to increase the PID limitation on any Docker container, you can use the option --pids-limit since Docker Engine 1.11. The documentation can be found here, in the docker run documentation from docs.docker.com.

It says:

--pids-limit        Tune container pids limit (set -1 for unlimited)

You must restart your container with this option. And by restart, I mean delete it then start it again (ensure you won't loose any data doing this).

There are reasons why the PID are limited, for example, it avoids fork bomb. But the limitation is not 10 PIDs but 512 (actual number may change):

This is a new cgroup to limit the number of processes that can be forked inside a cgroup. It shipped in the 4.3 kernel.

We decided to make this feature secure by default, meaning we are setting the PIDs Limit for the docker cgroup parent to 512 (actual number may change but something along these lines), more than enough for the average user, but not enough to do great harm.

Of course if you need more you can override the default, or even set it as unlimited.

[...]

See how easy it is to prevent a fork bomb with --pids-limit for a container.

- Docker Engine 1.10 Security Improvements, by Jessie Frazelle on 02/04/2016, Docker Blog

Upvotes: 1

Related Questions