How to determine resource limit for Openshift Pods required for my tomcat application?

2/8/2019

I've a web application (soap service) running in Tomcat 8 server in Openshift. The payload size is relatively small with 5-10 elements and the traffic is also small (300 calls per day, 5-10 max threads at a time). I'm little confused on the Pod resource restriction. How do I come up with min and max cpu and memory limits for each pod if I'm going to use min 1 and max 3 pods for my application?

-- pai
capacity-planning
kubernetes
openshift
openshift-origin
redhat-containers

1 Answer

2/10/2019

It's tricky to configure accurate limitation value without performance test. Because we don't expect your application is required how much resources process per requests. A good rule of thumb is to limit the resource based on heaviest workload on your environment. Memory limitation can trigger OOM-killer, so you should set up afforded value which is based on your tomcat heap and static memory size. As opposed to CPU limitation will not kill your pod if reached the limitation value, but slow down the process speed.

My suggestion of each limitation value's starting point is as follows.

  • Memory: Tomcat(Java) memory size + 30% buffer
  • CPU: personally I think CPU limitation is useless to maximize the process performance and efficiency. Even though CPU usage is afforded and the pod can use full cpu resources to process the requests as soon as possible at that time, the limitation setting can disturb it. But if you should spread the resource usage evenly for suppressing some aggressive resource eater, you can consider the CPU limitation.

This answer might not be what you want to, but I hope it help you to consider your capacity planning.

-- Daein Park
Source: StackOverflow