Scaling an Application Using cf scale
Page last updated:
Factors such as user load, or the number and nature of tasks performed by an application, can change the disk space and memory the application uses. For many applications, increasing the available disk space or memory can improve overall performance. Similarly, running additional instances of an application can allow the application to handle increases in user load and concurrent requests. These adjustments are called scaling an application.
Use cf scale to scale your application up or down to meet changes in traffic or demand.
Note: You can configure your app to scale automatically based on rules that you set. See the Scaling an Application Using Autoscaler topic for more information.
Horizontally scaling an application creates or destroys instances of your application.
Incoming requests to your application are automatically load balanced across all instances of your application, and each instance handles tasks in parallel with every other instance. Adding more instances allows your application to handle increased traffic and demand.
cf scale APP -i INSTANCES to horizontally scale your application.
Cloud Foundry will increase or decrease the number of instances of your application to match
$ cf scale myApp -i 5
Vertically scaling an application changes the disk space limit or memory limit that Cloud Foundry applies to all instances of the application.
cf scale APP -k DISK to change the disk space limit applied to all
instances of your application.
DISK must be an integer followed by either an M, for megabytes, or G,
$ cf scale myApp -k 512M
cf scale APP -m MEMORY to change the memory limit applied to all instances
of your application.
MEMORY must be an integer followed by either an M, for megabytes, or
G, for gigabytes.
$ cf scale myApp -m 1G