Why is the container step slowing down my build?

Article ID:360048585252
Last Reviewed:2026-07-27()
1 minute readKnowledge base

Issue

I noticed that when using the container step, my build is getting slower.

Resolution

The container step introduces an overhead because internally it is directly using the Kubernetes API to run commands (while without it, only the remoting protocol is used). Therefore, as the container step makes Kubernetes API call, it can be limited by the Max connections to Kubernetes API. This value is set to 32 by default and you can increase it in the Cloud Configuration (under <jenkins_url>/manage/cloud).

To improve the performance of the container step, when using the Kubernetes Plugin version 4526.vdd5315b_e0d0d or later, consider enabling the Use active containers option in Manage Jenkins  Clouds. This routes metadata requests for sh steps inside the container step through the Remoting channel instead of making additional calls to the Kubernetes API.

This option is supported for Linux agents only. Windows agents continue to use the original WebSocket-based implementation even when the option is selected.

Tested product/plugin versions

References

This article is part of our Knowledge Base and is provided for guidance-based purposes only. The solutions or workarounds described here are not officially supported by CloudBees and may not be applicable in all environments. Use at your own discretion, and test changes in a safe environment before applying them to production systems.