High Availability in Cloud Foundry

Page last updated:

This topic explains how to configure Cloud Foundry (CF) for high availability (HA), and how Cloud Foundry is designed to ensure high availability at multiple layers.

Configuring High Availability

This section describes how to configure system components to ensure high availability. You accomplish this by scaling component VMs and locating them in multiple Availability Zones (AZs), so that their redundancy and distribution minimizes downtime during ongoing operation, product updates, and platform upgrades.

Scaling component VMs means changing the number of VM instances dedicated to running a functional component of the system. Scaling usually means increasing this number, while scaling down or scaling back means decreasing it.

Deploying or scaling applications to at least two instances per app also helps maintain high availability. For information about scaling applications and maintaining app uptime, see the Scaling an Application Using cf scale and Using Blue-Green Deployment to Reduce Downtime and Risk topics.

Availability Zones

During product updates and platform upgrades, the VMs in a deployment restart in succession, rendering them temporarily unavailable. During outages, VMs go down in a less orderly way. Spreading components across Availability Zones and scaling them to a sufficient level of redundancy maintains high availability during both upgrades and outages and can ensure zero downtime.

Deploying Cloud Foundry across three or more AZs and assigning multiple component instances to different AZ locations lets a deployment operate uninterrupted when entire AZs become unavailable. Cloud Foundry maintains its availability as long as a majority of the AZs remain accessible. For example, a three-AZ deployment stays up when one entire AZ goes down, and a five-AZ deployment can withstand an outage of up to two AZs with no impact on uptime.

Vertical and Horizontal Scaling

You can scale platform capacity vertically by adding memory and disk, or horizontally by adding more VMs running instances of Cloud Foundry components.

Scale cf

To scale vertically, ensure that you allocate and maintain enough of the following:

  • Free space on host VMs, whether they are Diego cells , so that apps expected to deploy can successfully be staged and run.
  • Disk space and memory in your deployment such that if one host VM is down, all instances of apps can be placed on the remaining Host VMs.
  • Free space to handle one AZ going down if deploying in multiple AZs.

Scaling up the following components horizontally also increases your capacity to host applications. The nature of the applications you host on Cloud Foundry should determine how you should scale vertically vs. horizontally.

Scalable Components

You can horizontally scale most Cloud Foundry components to multiple instances to achieve the redundancy required for high availability. You should also distribute the instances of multiply-scaled components across different availability zones (AZs). If you use more than three AZs, ensure that you use an odd number of AZs.

The following table provides recommended instance counts for a high-availability deployment. You can decrease the footprint of your deployment by specifying fewer instances and combining multiple components onto a single VM.

Component Job Name Prefix Total Instances Notes
Diego Cell cell_z ≥ 3 Specific to Diego architecture. The optimal balance between CPU/memory sizing and instance count depends on the performance characteristics of the apps that run on Diego cells. Scaling vertically with larger Diego cells makes for larger points of failure, and more apps go down when a cell fails. On the other hand, scaling horizontally decreases the speed at which the system rebalances apps. Rebalancing 100 cells takes longer and demands more processing overhead than rebalancing 20 cells.
Diego Brain brain_z ≥ 2 Specific to Diego architecture. One per AZ, or two if only one AZ.
Diego BBS diego_database_z ≥ 3 Specific to Diego architecture. Set this to to an odd number equal to or one greater than the number of AZs you have, in order to maintain quorum. Distribute the instances evenly across the AZs, at least one instance per AZ.
DEA runner_z ≥ 3 Specific to DEA architecture.
Health Manager (HM9000) hm9000_z ≥ 2 Specific to DEA architecture.
PostgreSQL Server postgres_z 0 or 1 0 if Postgres database is external.
MySQL Proxy mysql_proxy_z ≥ 2
NATS Server nats_z ≥ 2 You might run a single NATS instance if you lack the resources to deploy two stable NATS servers. Components using NATS are resilient to message failures and the BOSH resurrector recovers the NATS VM quickly if it becomes non-responsive.
Cloud Controller API api_z ≥ 2 Scale the Cloud Controller to accommodate the number of requests to the API and the number of apps in the system.
Cloud Controller Worker api_worker_z ≥ 2 Scale the Cloud Controller to accommodate the number of asynchronous requests to the API and background jobs.
Router router_z ≥ 2 Scale the router to accommodate the number of incoming requests. Additional instances increase available bandwidth. In general, this load is much less than the load on host VMs, whether Diego cells or DEAs.
HAProxy haproxy_z 0 or 1 For production environments, the best approach is to scale HAProxy to 0 and configure a high-availability load balancer (LB) to point directly to each Gorouter instance. You can also configure the LB to point to HAProxy scaled at 1. Either way, an LB is the best way to host Cloud Foundry domains at a single IP address. Round-robin DNS resolution to multiple HAProxy instances has not been tested for high availability.
UAA uaa_z ≥ 2
Doppler Server doppler_z ≥ 2 Deploying additional Doppler servers splits traffic across them. Pivotal recommends to have at least two per Availability Zone.
Loggregator TC loggregator_z ≥ 2 Deploying additional Loggregator Traffic Controllers allows you to direct traffic to them in a round-robin manner. Pivotal recommends to have at least two per Availability Zone.

Blob Storage

For storing blobs, large binary files, the best approach for high availability is to use external storage such as Amazon S3 or an S3-compatible service.

If you store blobs internally using WebDAV or NFS, these components run as single instances and you cannot scale them. For these deployments, use the high availability features of your IaaS to immediately recover your WebDAV or NFS server VM if it fails. Contact Pivotal Web Services Support if you need assistance.

not affect platform availability.

Supporting Component Scaling

Resource Pools

Configure your resource pools according to the requirements of your deployment.

Each IaaS has different ways of limiting resource consumption for scaling VMs. Consult with your IaaS administrator to ensure additional VMs and related resources, like IPs and storage, will be available when scaling.


For database services deployed outside Cloud Foundry, plan to leverage your infrastructure’s high availability features and to configure backup and restore where possible.

Note: Data services may have single points of failure depending on their configuration.

Contact Pivotal Web Services Support if you need assistance.

How CF Maintains High Availability

This section explains how Pivotal Web Services (PWS) deployments include several layers of HA to keep applications running in the face of system failure. These layers include availability zones (AZs), application health management, process monitoring, and VM resurrection.

Availability Zones

PWS supports deploying applications instances across multiple AZs. This level of high availability requires that you define AZs in your IaaS. PWS balances the applications you deploy across the AZs you defined. If an AZ goes down, you still have application instances running in another.

Health Management for App Instances


Process Monitoring


Resurrection for VMs


For more information about the Resurrector, see the BOSH documentation.

Was this helpful?
What can we do to improve?
View the source for this page in GitHub