Applications running within OpenShift can increase capacity based on user load. This functionality is called 'auto-scaling'. OpenShift can auto-scale the number of pods based on the percentage of CPU being used by the current pods against the cpu request.
To create an auto-scaling rule via the command line:
- Example autoscaling command: oc autoscale dc/ruby-thin --max 5 --cpu-percent=80
- This means you will add additional pods up to 5 when 80% of your cpu request is exceeded.
To view the cpu request for your project, click on Resources in the left-hand side of the OpenShift interface, and in the resulting pop-up menu, select 'Quota'. The value you will be interested in is 'Default Request' for 'Container CPU'. Monitor the resource utilization of your pods to make an informed estimate of when you need to auto-scale. As the resources available to your pods is limited by the 'Limits', rather the 'Requests', in some cases auto-scaling will occur at values greater than 100% of the request.