LOG IN SIGN UP
Documentation

Creating and using pools with Dynamic Servers

  Last updated October 20, 2017

Fastly's Load Balancer allows you to create pools of origin servers that you dynamically manage using Fastly's Dynamic Servers feature to distribute and direct incoming requests. A pool is responsible for balancing requests among a group of origin servers. In addition to load balancing, pools can be configured to attempt retrying failed requests. Pools have a quorum setting that can be used to determine when the pool as a whole is considered up in order to prevent problems following an outage as origin servers come back up.

Creating a pool

To start using Dynamic Servers, you'll need to create an empty pool within a version of a service that's unlocked and not yet activated. Make the following API call in a terminal application:

curl -vs -H "Fastly-Key: FASTLY_API_TOKEN" -X POST https://api.fastly.com/service/<service_id>/version/<service_version>/pool -d 'name=<pool_name>&comment=<comment>'

The response will look like this:

{
    "between_bytes_timeout": "10000",
    "comment": "<comment>",
    "connect_timeout": "1000",
    "created_at": "2016-08-01T14:43:22+00:00",
    "deleted_at": null,
    "first_byte_timeout": "15000",
    "healthcheck": null,
    "id": "2IpWU5CGzPpbpGsABSDops",
    "max_conn_default": "200",
    "max_tls_version": null,
    "min_tls_version": null,
    "name": "<pool_name>",
    "quorum": "75",
    "request_condition": null,
    "service_id": "<service_id>",
    "shield": null,
    "tls_ca_cert": null,
    "tls_cert_hostname": null,
    "tls_check_cert": 1,
    "tls_ciphers": null,
    "tls_client_cert": null,
    "tls_client_key": null,
    "tls_sni_hostname": null,
    "type": "random",
    "updated_at": "2016-08-01T14:43:22+00:00",
    "use_tls": 0,
    "version": "<service_version>"
}

Be sure to activate the new version of the service you associated with the pool after adding at least one origin server.

Viewing pools

To view a list of all pools attached to a particular version of a service, make the following API call in a terminal application:

curl -vs -H "Fastly-Key: FASTLY_API_TOKEN" https://api.fastly.com/service/<service_id>/version/<service_version>/pool

The response will look like this:

[
{
    "between_bytes_timeout": "10000",
    "comment": "just my first pool",
    "connect_timeout": "1000",
    "created_at": "2016-08-01T14:43:22+00:00",
    "deleted_at": null,
    "first_byte_timeout": "15000",
    "healthcheck": null,
    "id": "2IpWU5CGzPpbpGsABSDops",
    "max_conn_default": "200",
    "max_tls_version": null,
    "min_tls_version": null,
    "name": "SP_Prod_Pool_1",
    "quorum": "75",
    "request_condition": null,
    "service_id": "<service_id>",
    "shield": null,
    "tls_ca_cert": null,
    "tls_cert_hostname": null,
    "tls_check_cert": 1,
    "tls_ciphers": null,
    "tls_client_cert": null,
    "tls_client_key": null,
    "tls_sni_hostname": null,
    "type": "random",
    "updated_at": "2016-08-01T14:43:22+00:00",
    "use_tls": 0,
    "version": "<service_version>"
}
]

To see information related to a single pool (in this example, SP_Prod_Pool_1) attached to a particular version of a service, make the following API call in a terminal application:

curl -vs -H "Fastly-Key: FASTLY_API_TOKEN" https://api.fastly.com/service/<service_id>/version/<service_version>/pool/<pool_name>

The response will look like this:

{
    "between_bytes_timeout": "10000",
    "comment": "just my first pool",
    "connect_timeout": "1000",
    "created_at": "2016-08-01T14:43:22+00:00",
    "deleted_at": null,
    "first_byte_timeout": "15000",
    "healthcheck": null,
    "id": "2IpWU5CGzPpbpGsABSDops",
    "max_conn_default": "200",
    "max_tls_version": null,
    "min_tls_version": null,
    "name": "SP_Prod_Pool_1",
    "quorum": "75",
    "request_condition": null,
    "service_id": "<service_id>",
    "shield": null,
    "tls_ca_cert": null,
    "tls_cert_hostname": null,
    "tls_check_cert": 1,
    "tls_ciphers": null,
    "tls_client_cert": null,
    "tls_client_key": null,
    "tls_sni_hostname": null,
    "type": "random",
    "updated_at": "2016-08-01T14:43:22+00:00",
    "use_tls": 0,
    "version": "<service_version>"
}

Deleting a pool

Deleting a pool deletes the pool and all of its associated server entries. To delete a pool (in this example, SP_Prod_Pool_1), make the following API call in a terminal application:

curl -vs -H "Fastly-Key: FASTLY_API_TOKEN" -X DELETE https://api.fastly.com/service/<service_id>/version/<service_version>/pool/<pool_id>

The response will look like this:

{
  "status":"ok"
}

Additional resources:


Back to Top