`nerdctl ps` is slow when there are containers whch have `Unknown` status

Open
#4,720 1 comment 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 3 days

@haytok is already working on this.

Since Jan 26, 2026.

Assessment

This issue has not been assessed yet.

Description

enhancement
Description

When a container's shim process is stopped (e.g., via kill -STOP), nerdctl ps and nerdctl ps -a take approximately 4 seconds to return results.

$ time sudo nerdctl ps
CONTAINER ID    IMAGE    COMMAND    CREATED    STATUS    PORTS    NAMES

real	0m4.068s
user	0m0.007s
sys	0m0.017s

$ time sudo nerdctl ps -a
CONTAINER ID    IMAGE                              COMMAND        CREATED           STATUS     PORTS    NAMES
69e240372293    docker.io/library/alpine:latest    "sleep inf"    14 seconds ago    Unknown             hoge

real	0m4.033s
user	0m0.002s
sys	0m0.003s
Steps to reproduce the issue
ID=$(sudo nerdctl run -d --name hoge alpine sleep inf)
PID=$(ps aux | grep "containerd-shim.*$ID" | grep -v grep | awk '{print $2}')
sudo kill -STOP $PID
sudo nerdctl ps -a 
Describe the results you received and expected

Improve the display speed of the response when executing the nerdctl ps or nerdctl ps -a command where Unknown containers exist.

What version of nerdctl are you using?

latest

Details

$ sudo nerdctl version
Client:
 Version:       30bc9938.m
 OS/Arch:       linux/arm64
 Git commit:    30bc99387ff83cad68ea6f323560fd929b23fdb6.m
 buildctl:
  Version:      v0.18.0
  GitCommit:    95d190ef4f18b57c717eaad703b67cb2be781ebb

Server:
 containerd:
  Version:      89c7170db.m
  GitCommit:    89c7170db5d4f11868508001dda9ff18775705e1.m
 runc:
  Version:      1.2.2
  GitCommit:    v1.2.2-0-g7cb36325

Are you using a variant of nerdctl? (e.g., Rancher Desktop)

Lima

Host information
Details

$ sudo nerdctl info
Client:
 Namespace:	default
 Debug Mode:	false

Server:
 Server Version: 89c7170db.m
 Storage Driver: overlayfs
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Log:     fluentd journald json-file none syslog
  Storage: native overlayfs stargz
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version:   6.11.0-29-generic
 Operating System: Ubuntu 24.10
 OSType:           linux
 Architecture:     aarch64
 CPUs:             4
 Total Memory:     3.812GiB
 Name:             lima-haytok
 ID:               149f0072-b6bb-4d8a-97d8-e3b856af08c3
$ uname -ra
Linux lima-haytok 6.11.0-29-generic #29-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 13 20:32:41 UTC 2025 aarch64 aarch64 aarch64 GNU/Linux

Dominant language
Go
Stars
10.5k
Forks
853
Avg merge
6d 14h
Merged PRs (30d)
38

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from containerd/nerdctl

All issues in containerd/nerdctl

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.