Cluster Sizing
Cluster sizing recommends number of pods of each type that are required for different Queries Per Seconds (QPS).
Pod or Container Sizing
Pod sizing covers two aspects- resources required by a pod and number of pods required for a given QPS and number of refresh token requests for OAuth.
The sizing guidelines are generic and resource requirements will vary by factors like average payload per traffic request and response, size of config, and number of oauth (refresh + create tokens) requests.
Because of the upstream feature of td-agent-bit; number of log pods are nearer to the number of tm pods.
Pod Characteristics
Pod Type | Menu Usage | CPU Usage | Storage Usage | Network |
---|---|---|---|---|
TML-NoSQL | Normal - High (in case of large Oauth traffic) | Normal | High in case of large oauth traffic | High due to registry activity |
TML-CM | High (host 4 services) | Normal | Low | Low |
TML-LOG | High | High | Very high | very high |
TML-SQL | Normal | Normal | Normal | Normal |
TML-Cache | High | Normal | low | High (depending on traffic calls) |
TML-TM | Normal (will see a lot of G1GC young gc activity) | High | very low | High |
TML-Reporting | Hiigh | High | Very High | High |
Limits and Requests
Requests are initial allocation of resources and limits define the max memory or cpu a pod can utilise.
We can define limits for CPU/CPU time and memory required. When defining limits a general recommendation is to set the value for requests to half of limit. A general rule of thumb is to allow a 20% overhead or bump up space for memory and CPU and to ensure that the application is not paging.
- Pods and containers consume resources and there will be situations where one pod can consume more resources leaving other pods starved for them; a starved pod will be restarted.
- Memory leaks in the application will drain nodes of memory
- Optimizes use of resources instead of over-provisioning
- Allows for automatic horizontal scaling of Cache, Log and traffic manager pods
For more information about units of resource:
- For kubernetes, see Resource Units in Kubernetes
- For docker, see Runtime options with Memory, CPUs, and GPUs
Kubernetes Pod Sizing
Service | Number of Pods | Expected Utilization per Pod | |
---|---|---|---|
Memory | CPU | ||
Cluster manager | 1 | 1GB | 500m/0.5 cpu time |
SQL | 1 | 1GB | 100m/0.1 cpu time |
NoSQL | 1 | 2GB | 500m/0.5 cpu time |
Cache | 1 | 500MB | 100m/0.1 cpu time |
Log | 1 | 1GB | 500m/0.5 cpu time |
TM | 1 | 500MB | 500m/0.5 cpu time |
Reporting | 1 | 1GB | 100m/0.1 cpu time |
Service | Number of Pods | Observed Utilization Per Pod | Memory Per Pod | CPU Per Pod | |||
---|---|---|---|---|---|---|---|
Memory | CPU | Request | Limit | Request | Limit | ||
Cluster manager | 1 | 1GB | 500m/0.5 cpu time | 1000Mi | 1250Mi | 500m | 625m |
SQL | 1 | 1GB | 500m/0.5 cpu time | 1000Mi | 1250Mi | 500m | 625m |
NoSQL | 1 | 1 GB | 1200m/1.2 cpu time | 1000Mi | 1250mi | 1000m | 1500m |
Cache | 1 | 500MB | 500m/0.5 cpu time | 500mi | 625Mi | 500m | 625m |
Log | 1 | 2GB | 1200m/1.2 cpu time | 1000Mi | 2500mi | 1000m | 1500m |
TM | 1 | 1.5GB | 1500m/1.5 cpu time | 1000Mi | 1900mi | 1000m | 1900m |
Reporting | 1 | 1GB | 500m/0.5 cpu time | 1000Mi | 1250Mi | 500m | 625m |
Service | Number of Pods | Observed Utilization Per Pod | Memory Per Pod | CPU Per Pod | |||
---|---|---|---|---|---|---|---|
Memory | CPU | Request | Limit | Request | Limit | ||
Cluster manager | 1 | 1GB | 500m/0.5 cpu time | 1000Mi | 1250Mi | 500m | 625m |
SQL | 1 | 1GB | 500m/0.5 cpu time | 1000Mi | 1250Mi | 500m | 625m |
NoSQL | 3 | 1 GB | 1200m/1.2 cpu time | 1000Mi | 1250mi | 1000m | 1500m |
Cache | 2 | 1 GB | 500m/0.5 cpu time | 1000Mi | 1250mi | 500m | 625m |
Log | 4 | 2GB | 1200m/1.2 cpu time | 1000Mi | 2500mi | 1000m | 1500m |
TM | 5 | 1.2GB | 1200m/1.2 cpu time | 1000Mi | 1500mi | 1000m | 1500m |
Reporting | 1 | 1GB | 500m/0.5 cpu time | 1000Mi | 1250Mi | 500m | 625m |
Service | Number of Pods | Observed Utilization Per Pod | Memory Per Pod | CPU Per Pod | |||
---|---|---|---|---|---|---|---|
Memory | CPU | Request | Limit | Request | Limit | ||
Cluster manager | 1 | 1GB | 500m/0.5 cpu time | 1000Mi | 1250Mi | 500m | 625m |
SQL | 1 | 1GB | 500m/0.5 cpu time | 1000Mi | 1250Mi | 500m | 625m |
NoSQL | 3 | 1 GB | 1200m/1.2 cpu time | 1000Mi | 1250mi | 1000m | 1500m |
Cache | 2 | 1 GB | 500m/0.5 cpu time | 500Mi | 1250mi | 500m | 625m |
Log | 8 | 2.2GB | 1200m/1.2 cpu time | 1000Mi | 2750mi | 1000m | 1500m |
TM | 10 | 1.2GB | 1200m/1.2 cpu time | 1000Mi | 1500mi | 1000m | 1500m |
Reporting | 1 | 1.5GB | 3000m/3 cpu time | 1000Mi | 1900Mi | 500m | 3750m |
Requirements for different QPS shown here are based on actual observation and the number of pods for TM, Cache and Log have been determined by the following HPA rules:
kubectl autoscale deployment tm-deploy-0 --min=1 --max=5 --cpu-percent=80 kubectl autoscale statefulsets log-set-0 --min=1 --max=5 --cpu-percent=80 kubectl autoscale statefulsets cache-set-0 --min=1 --max=5 --cpu-percent=80
Pod Placement on Nodes
In the case where users would not like to request and set resource limits, the resource usage characteristics of each pod dictate placement of workloads on nodes. High availability deployment also dictates that pods of same type don't end up on same node.