Question
Docker starts 5 docker processes
I’m using the Docker default one-click-install from DO. If I restart my droplet, There are 5 docker processes running. My pstree
looks something like this.
~# pstree -p
init(1)─┬─acpid(971)
├─atd(973)
├─cron(972)
├─dbus-daemon(741)
├─docker(1709)─┬─{docker}(1715)
│ ├─{docker}(1717)
│ ├─{docker}(1718)
│ ├─{docker}(1719)
│ └─{docker}(1720)
├─getty(931)
├─getty(934)
├─getty(939)
├─getty(940)
├─getty(942)
├─getty(1565)
├─nginx(1021)───nginx(1022)
├─rsyslogd(850)─┬─{rsyslogd}(851)
│ ├─{rsyslogd}(852)
│ └─{rsyslogd}(853)
├─sendmail-mta(1491)
├─sshd(966)───sshd(1348)───bash(1406)───pstree(1748)
├─systemd-logind(843)
├─systemd-udevd(385)
├─upstart-file-br(878)
├─upstart-socket-(680)
└─upstart-udev-br(371)
The problem is that if I have multiple containers running, they will also run 5x times and create a lot of unnecessary processes. Because of that, I’m have to use a 10gb droplet that runs out of memory very quickly, despite getting almost no traffic.
This is how my pstree
looks like after building and running a container.
~# pstree -p
init(1)─┬─acpid(971)
├─atd(973)
├─cron(972)
├─dbus-daemon(741)
├─docker(1709)─┬─docker(1985)─┬─{docker}(1986)
│ │ ├─{docker}(1987)
│ │ ├─{docker}(1988)
│ │ ├─{docker}(1989)
│ │ └─{docker}(1990)
│ ├─ghost-start(1991)───su(2022)───bash(2023)───npm(2024)─┬─sh(2030)───node(2031)─┬─{node}(2032)
│ │ │ ├─{node}(2033)
│ │ │ ├─{node}(2034)
│ │ │ ├─{node}(2035)
│ │ │ └─{node}(2036)
│ │ ├─{npm}(2025)
│ │ ├─{npm}(2026)
│ │ ├─{npm}(2027)
│ │ ├─{npm}(2028)
│ │ └─{npm}(2029)
│ ├─{docker}(1715)
│ ├─{docker}(1717)
│ ├─{docker}(1718)
│ ├─{docker}(1719)
│ ├─{docker}(1720)
│ ├─{docker}(1910)
│ ├─{docker}(1911)
│ ├─{docker}(1912)
│ ├─{docker}(2013)
│ └─{docker}(2016)
├─getty(931)
├─getty(934)
├─getty(939)
├─getty(940)
├─getty(942)
├─getty(1565)
├─nginx(1021)───nginx(1022)
├─rsyslogd(850)─┬─{rsyslogd}(851)
│ ├─{rsyslogd}(852)
│ └─{rsyslogd}(853)
├─sendmail-mta(1491)
├─sshd(966)───sshd(2037)───bash(2085)───pstree(2100)
├─systemd-logind(843)
├─systemd-udevd(385)
├─upstart-file-br(878)
├─upstart-socket-(680)
└─upstart-udev-br(371)
Docker version:
~# docker -v
Docker version 1.6.0, build 4749651
I’m using fig 1.0.0 (Should probably switch to docker-compose
).
Question
What’s the best way to reduce the number of processes to just one? Why are there 5 docker processes running? Is there a reason this was setup this way in the first place?
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×