About recommended RAM memory limit for Jenkins master docker for k8s deployment

1,341 views
Skip to first unread message

Mahesh Wabale

unread,
Jan 29, 2020, 2:34:00 PM1/29/20
to Jenkins Users
My Jenkins is deployed on k8s , i have configured 60 slaves in setup which are also on k8s, there are around 60 concurrent builds are expected . Using NFS 4.1 . Want to understand what should be recommended size for RAM size limit in GB for Jenkins master docker image so that my setup will work without any issues . Or should it be unlimited .

James Nord

unread,
Jan 29, 2020, 4:27:30 PM1/29/20
to Jenkins Users
unfortunately there is no quick answer.
I have seen much bigger instances work flawlessly with 4GB and much smaller instances need 32GB.

the big difference is on what plugins you have installed, especially around report visualisation / transformation and if you are using pipelines that you are following best practices and not putting build logic into the pipeline bit only flow.

as with any service in production I would recommend a monitoring service that shows you the pods consumed memory / CPU and JVM heap / off heap memory along with GC logs and tune based on your actual workload.
with k8s I would recommend that you specify a request and limit for CPU and memory to avoid any suprises, the memory will need some headroom o we what Jenkins itself uses as it will often spawn processes for SCM integration / polling

Mahesh Wabale

unread,
Feb 4, 2020, 12:26:36 AM2/4/20
to Jenkins Users

I am able to free cache memory for Jenkins master pod docker container . As per docker image behaviour its taking resources from k8s node where it is deployed . 

You can verify memory usage by below commands from docker container . 

bash-4.4$ cat /sys/fs/cgroup/memory/memory.limit_in_bytes

bash-4.4$ cat /sys/fs/cgroup/memory/memory.max_usage_in_bytes

bash-4.4$ cat /sys/fs/cgroup/memory/memory.stat | grep cache

bash-4.4$ 


Solution , delete cache memory for k8s node where your Jenkins master pod docker container is running , there will be no downtime required for Jenkins service . 

Thanks , 
Reply all
Reply to author
Forward
0 new messages