-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Description
Feature request description
First of all, thank you for the amazing work on Podman — it's been a game-changer for container management without needing a daemon.
I’d like to propose a feature enhancement for podman exec: the ability to set CPU and memory limits for processes executed via exec.
In some scenarios, especially in production environments, we need to run ad-hoc commands inside containers (e.g., database queries, diagnostics, or batch jobs) using podman exec. However, these processes can consume excessive resources and impact the container’s overall performance.
Currently, resource limits (like --cpus or --memory) can only be set at container creation. It would be extremely useful to apply temporary resource constraints to individual processes launched via podman exec.
Suggest potential solution
Introduce optional flags to podman exec, such as:
podman exec --cpus=0.5 --memory=256m
These flags would:
- Create a temporary cgroup for the exec’d process
- Apply the specified resource limits
- Clean up after the process exits
This would allow better control over resource usage without needing to spawn a separate container just for one command.