Creating and using pools with Dynamic Servers

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.

IMPORTANT

This information is part of a limited availability release. For additional details, read our product and feature lifecycle descriptions.

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:

1{
2 "between_bytes_timeout": "10000",
3 "comment": "<comment>",
4 "connect_timeout": "1000",
5 "created_at": "2016-08-01T14:43:22+00:00",
6 "deleted_at": null,
7 "first_byte_timeout": "15000",
8 "healthcheck": null,
9 "id": "2IpWU5CGzPpbpGsABSDops",
10 "max_conn_default": "200",
11 "max_tls_version": null,
12 "min_tls_version": null,
13 "name": "<pool_name>",
14 "quorum": "75",
15 "request_condition": null,
16 "service_id": "<service_id>",
17 "shield": null,
18 "tls_ca_cert": null,
19 "tls_cert_hostname": null,
20 "tls_check_cert": 1,
21 "tls_ciphers": null,
22 "tls_client_cert": null,
23 "tls_client_key": null,
24 "tls_sni_hostname": null,
25 "type": "random",
26 "updated_at": "2016-08-01T14:43:22+00:00",
27 "use_tls": 0,
28 "version": "<service_version>"
29}

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

NOTE

Each Fastly service can be configured with up to five origin servers. Contact sales@fastly.com to enable more than five origin servers per service in your account.

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:

1[
2{
3 "between_bytes_timeout": "10000",
4 "comment": "just my first pool",
5 "connect_timeout": "1000",
6 "created_at": "2016-08-01T14:43:22+00:00",
7 "deleted_at": null,
8 "first_byte_timeout": "15000",
9 "healthcheck": null,
10 "id": "2IpWU5CGzPpbpGsABSDops",
11 "max_conn_default": "200",
12 "max_tls_version": null,
13 "min_tls_version": null,
14 "name": "SP_Prod_Pool_1",
15 "quorum": "75",
16 "request_condition": null,
17 "service_id": "<service_id>",
18 "shield": null,
19 "tls_ca_cert": null,
20 "tls_cert_hostname": null,
21 "tls_check_cert": 1,
22 "tls_ciphers": null,
23 "tls_client_cert": null,
24 "tls_client_key": null,
25 "tls_sni_hostname": null,
26 "type": "random",
27 "updated_at": "2016-08-01T14:43:22+00:00",
28 "use_tls": 0,
29 "version": "<service_version>"
30}
31]

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:

1{
2 "between_bytes_timeout": "10000",
3 "comment": "just my first pool",
4 "connect_timeout": "1000",
5 "created_at": "2016-08-01T14:43:22+00:00",
6 "deleted_at": null,
7 "first_byte_timeout": "15000",
8 "healthcheck": null,
9 "id": "2IpWU5CGzPpbpGsABSDops",
10 "max_conn_default": "200",
11 "max_tls_version": null,
12 "min_tls_version": null,
13 "name": "SP_Prod_Pool_1",
14 "quorum": "75",
15 "request_condition": null,
16 "service_id": "<service_id>",
17 "shield": null,
18 "tls_ca_cert": null,
19 "tls_cert_hostname": null,
20 "tls_check_cert": 1,
21 "tls_ciphers": null,
22 "tls_client_cert": null,
23 "tls_client_key": null,
24 "tls_sni_hostname": null,
25 "type": "random",
26 "updated_at": "2016-08-01T14:43:22+00:00",
27 "use_tls": 0,
28 "version": "<service_version>"
29}

Deleting a pool

Deleting a pool deletes the pool and all of its associated server entries. To delete a pool, 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_name>

The response will look like this:

1{
2 "status":"ok"
3}
Was this guide helpful?

Do not use this form to send sensitive information. If you need assistance, contact support.