Skip to contentSkip to conversation

pidns: Make pid accounting and pid_max per namespace

DISCUSSION Zhang Haoyu 3 participants 5 messages Oct 9, 2015 – Oct 10, 2015 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

I started multiple docker containers in centos6.6(linux-2.6.32-504.16.2), and there's one bad program was running in one container.
This program produced many child threads continuously without free, so more and more pid numbers were consumed by this program, until hitting the pix_max limit (32768 default in my system ).

What's worse is that containers and host share the pid numbers resource, so new program cannot be produced any more in host and other containers.

And, I clone the upstream kernel source from
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
This problem is still there, I'm not sure.

IMO, we should isolate the pid accounting and pid_max between pid namespaces, and make them per pidns.
Below post had request for making pid_max per pidns.
http://thread.gmane.org/gmane.linux.kernel/1108167/focus=1111210

Thanks,
Zhang Haoyu

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 9 lines · Zhang Haoyu

I started multiple docker containers in centos6.6(linux-2.6.32-504.16.2), and there's one bad program was running in one container.
This program produced many child threads continuously without free, so more and more pid numbers were consumed by this program, until hitting the pix_max limit (32768 default in my system ).

What's worse is that containers and host share the pid numbers resource, so new program cannot be produced any more in host and other containers.

Quoted 9 lines

And, I clone the upstream kernel source from
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
This problem is still there, I'm not sure.

IMO, we should isolate the pid accounting and pid_max between pid namespaces, and make them per pidns.
Below post had request for making pid_max per pidns.
http://thread.gmane.org/gmane.linux.kernel/1108167/focus=1111210

Mainline kernel already supports per-cgroup pid limit, which should solve your problem.

#3 lore raw
In reply to Zhang Haoyu
Quoted 9 lines · Zhang Haoyu

I started multiple docker containers in centos6.6(linux-2.6.32-504.16.2), and there's one bad program was running in one container.
This program produced many child threads continuously without free, so more and more pid numbers were consumed by this program, until hitting the pix_max limit (32768 default in my system ).

What's worse is that containers and host share the pid numbers resource, so new program cannot be produced any more in host and other containers.

Quoted 9 lines

And, I clone the upstream kernel source from
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
This problem is still there, I'm not sure.

IMO, we should isolate the pid accounting and pid_max between pid namespaces, and make them per pidns.
Below post had request for making pid_max per pidns.
http://thread.gmane.org/gmane.linux.kernel/1108167/focus=1111210

Mainline kernel already supports per-cgroup pid limit, which should solve your problem.

#4 lore raw
Quoted 14 lines · Zefan Li
Quoted 13 lines · Zhang Haoyu

I started multiple docker containers in centos6.6(linux-2.6.32-504.16.2), and there's one bad program was running in one container.
This program produced many child threads continuously without free, so more and more pid numbers were consumed by this program, until hitting the pix_max limit (32768 default in my system ).

What's worse is that containers and host share the pid numbers resource, so new program cannot be produced any more in host and other containers.

And, I clone the upstream kernel source from
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
This problem is still there, I'm not sure.

Quoted 9 lines
Quoted 5 lines

IMO, we should isolate the pid accounting and pid_max between pid namespaces, and make them per pidns.
Below post had request for making pid_max per pidns.
http://thread.gmane.org/gmane.linux.kernel/1108167/focus=1111210

Mainline kernel already supports per-cgroup pid limit, which should solve your problem.

What about pid accounting?
If one pidns consume too many pids, dose it influence the other pid namespaces?

Thanks,
Zhang Haoyu

#5 lore raw
Quoted 20 lines · Zhang Haoyu
Quoted 19 lines · Zefan Li
Quoted 18 lines · Zhang Haoyu

I started multiple docker containers in centos6.6(linux-2.6.32-504.16.2), and there's one bad program was running in one container.
This program produced many child threads continuously without free, so more and more pid numbers were consumed by this program, until hitting the pix_max limit (32768 default in my system ).

What's worse is that containers and host share the pid numbers resource, so new program cannot be produced any more in host and other containers.

And, I clone the upstream kernel source from
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
This problem is still there, I'm not sure.

IMO, we should isolate the pid accounting and pid_max between pid namespaces, and make them per pidns.
Below post had request for making pid_max per pidns.
http://thread.gmane.org/gmane.linux.kernel/1108167/focus=1111210

Quoted 5 lines
Quoted 3 lines

Mainline kernel already supports per-cgroup pid limit, which should solve your problem.

What about pid accounting?
If one pidns consume too many pids, dose it influence the other pid namespaces?

I found it, thanks very much.

Quoted 3 lines

Thanks,
Zhang Haoyu