Debug School

prashant
prashant

Posted on

diff between docker pause and docker unpause?

Docker pause cmd:- suspends all processes in the specified container that means allocated cpu to that process is 0%.

Docker unpause cmd:- un-suspends all processes in the specified containers. On Linux, it does this using the freezer cgroup.

[root@localhost ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c91a0f994f47 httpd "httpd-foreground" 21 minutes ago Exited (137) 12 minutes ago kind_meitner
66d23993e0e4 httpd "httpd-foreground" 22 minutes ago Exited (0) 11 minutes ago clever_leavitt
c213671a8288 httpd "httpd-foreground" 22 minutes ago Up 22 minutes 0.0.0.0:80->80/tcp, :::80- >80/tcp admiring_faraday
708a7964a45f httpd "httpd-foreground" 23 minutes ago Up 23 minutes 80/tcp romantic_kepler
b21cb4ba98f8 httpd "httpd-foreground" About an hour ago Up 50 minutes 80/tcp raj2
a5151e54aa53 httpd "httpd-foreground" About an hour ago Created objective_austin
[root@localhost ~]# docker pause c213671a8288
c213671a8288
[root@localhost ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c91a0f994f47 httpd "httpd-foreground" 22 minutes ago Exited (137) 12 minutes ago kind_meitner
66d23993e0e4 httpd "httpd-foreground" 23 minutes ago Exited (0) 12 minutes ago clever_leavitt
c213671a8288 httpd "httpd-foreground" 23 minutes ago Up 23 minutes (Paused) 0.0.0.0:80->80/tcp, :::80- >80/tcp admiring_faraday
708a7964a45f httpd "httpd-foreground" 23 minutes ago Up 23 minutes 80/tcp romantic_kepler
b21cb4ba98f8 httpd "httpd-foreground" About an hour ago Up 51 minutes 80/tcp raj2
a5151e54aa53 httpd "httpd-foreground" About an hour ago Created objective_austin
[root@localhost ~]# docker stats
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
c213671a8288 admiring_faraday 0.00% 8.781MiB / 3.701GiB 0.23% 656B / 0B 0B / 0B 82
[root@localhost ~]# docker unpause c213671a8288
c213671a8288
[root@localhost ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAME S
c213671a8288 httpd "httpd-foreground" 23 minutes ago Up 23 minutes 0.0.0.0:80->80/tcp, :::80->80/tcp admi ring_faraday
708a7964a45f httpd "httpd-foreground" 24 minutes ago Up 24 minutes 80/tcp roma ntic_kepler
b21cb4ba98f8 httpd "httpd-foreground" About an hour ago Up 51 minutes 80/tcp raj2
[root@localhost ~]# docker stats
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
c213671a8288 admiring_faraday 0.00% 8.781MiB / 3.701GiB 0.23% 656B / 0B 0B / 0B 82
708a7964a45f romantic_kepler 0.00% 8.777MiB / 3.701GiB 0.23% 656B / 0B 0B / 0B 82
b21cb4ba98f8 raj2 0.00%

Top comments (0)