We Value Your Time – OpenSource Community
We Value Your Time – OpenSource Community

How to resolve exceeded num_locks in Podman

exceeded num_locks in Podman

The exceeded num_locks in Podman occurs when the number of locks on a container exceeds the limit set in the configuration.

To resolve this issue, We need to either increase the number of locks available to containers by updating the Podman configuration file or clean up the resources consumed by Podman.

Error Statement (allocation failed; exceeded num_locks)

Error: error creating named volume “”: allocating lock for new volume: allocation failed; exceeded num_locks (2048)

[DevOps@DevOpsForU ~]# podman run docker.io/library/nginx:latest
Error: error allocating lock for new container: allocation failed; exceeded num_locks (2048)
[DevOps@DevOpsForU ~]# sudo podman volume ls | wc -l

Solution 1

Can be solved by removing unused volume

[DevOps@DevOpsForU ~]# podman volume rm --all

Solution 2

If there is an actual need for resources then this issue can be solved by increasing the number of locks, which can add the following line to the “/etc/containers/containers.conf” file:

  runtime_root = "/var/run/containerd"
  process_start_timeout = "0s"
  systemd_cgroup = false
  num_locks = 2046

This will increase the number of locks available to 2048, which should resolve the “exceeded num_locks” error. However, it’s important to note that increasing the number of locks may also increase the system’s resource usage, so it’s important to set a value that is appropriate for your system.

Hope this tutorial was informative and added some value. Please bookmark https://syshunt.com to get preferred results in your google search queries. Like us on Facebook.

You may also like Kubernetes 1.26 Installation with Cilium

Leave a comment

Your email address will not be published. Required fields are marked *

One thought on “How to resolve exceeded num_locks in Podman”