Resource limits for step containers #2256
Replies: 2 comments
-
The above was in expectation of a problem .But now I actually ran into the problem for real. (It took a LONG time to diagnose the issue - the problem needs to be "surfaced" better. I had to enable trace logging and watch woodpecker server container logs.) I set memory and cpu constraints for the server and agent containers, but it's unclear how to do that for step containers - as discussed above. On a "smallish" VPS, a step container gobbled up all available memory and the pipeline was cancelled. Only after looking into the trace logs did I find the reason:
I would expect that in such a case the system would use swap memory instead, but it didn't. We need to be able to set resource constraints on step containers to avoid this issue. And it should be logged somewhere that is easily accessible so the woodpecker admin knows to tweak the settings, or buy more memory. |
Beta Was this translation helpful? Give feedback.
-
Related: #447 |
Beta Was this translation helpful? Give feedback.
-
I originally posted on discord, twice, without resolution. I assume that means what I've described isn't currently possible, hence this feature request.
Clear and concise description of the problem
In a memory constrained VPS, I'd like to set memory and cpu limits, because (even for a small build) the memory use spikes and impacts other docker services. I think the issue is not for the server or agent containers, but rather the ephemeral "step containers".
Typically one would set (in
docker-compose.yml
) resource limits for such containers:I found env vars in the docs but evidently they don't represent the same idea as the code above.
The docs state:
and
I'm unsure why these options were made available, or what is their use case - my guess is woodpecker is using a go docker library which exposes this functionality, and so wraps it?
Suggested solution
What's missing is cpu throttling by percentage, like docker does it. So for example:
- WOODPECKER_LIMIT_CPU_PERCENT=0.25
Alternative
There is no alternative, from what I can tell? The step containers use as much CPU as they need.
Additional context
Thanks.
Validations
next
version already [https://woodpecker-ci.org/faq#which-version-of-woodpecker-should-i-use]Environment
1.0.0
docker
Beta Was this translation helpful? Give feedback.
All reactions