Skip to content

Commit

Permalink
feat: Add ability to disable connection-pooling behavior for Dynamic …
Browse files Browse the repository at this point in the history
…Backends

This commit adds a new `dontPool` optional property to the `Backend` constructor, which indicates whether or not to disable connection-pooling.

Connection pooling is the ability to re-use connections across different executions/sessions of a Fastly Compute@Edge Service
Fastly considers two backends "the same" if they’re registered with the same name and the exact same settings.
In those cases, when connection pooling is enabled, if an execution/session opens a connection to a backend, the connection will be left open, and can be re-used by another execution/session.
This pooling behaviour can help improve backend latency, by removing the need for the initial network / TLS handshake(s).
By default, pooling is enabled for Dynamic Backends, but can be disabled when using the Explicit Dynamic Backend API.
  • Loading branch information
JakeChampion committed Jul 11, 2023
1 parent c0c4378 commit 50a26c0
Show file tree
Hide file tree
Showing 16 changed files with 539 additions and 260 deletions.
1 change: 1 addition & 0 deletions c-dependencies/spidermonkey
Submodule spidermonkey added at 3e87ca
6 changes: 6 additions & 0 deletions documentation/docs/fastly:backend/Backend/Backend.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ new Backend(backendConfiguration)
- Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32
- `useSSL` _: boolean_ _**optional**_
- Whether or not to require TLS for connections to this backend.
- `dontPool` _: boolean_ _**optional**_
- Determine whether or not connections to the same backend should be pooled across different sessions.
- Fastly considers two backends “the same” if they're registered with the same name and the exact same settings.
- In those cases, when pooling is enabled, if Session 1 opens a connection to this backend it will be left open, and can be re-used by Session 2.
- This can help improve backend latency, by removing the need for the initial network / TLS handshake(s).
- By default, pooling is enabled for dynamic backends.
- `tlsMinVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_
- Minimum allowed TLS version on SSL connections to this backend.
- If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead.
Expand Down
241 changes: 131 additions & 110 deletions integration-tests/js-compute/fixtures/dynamic-backend/bin/index.js

Large diffs are not rendered by default.

0 comments on commit 50a26c0

Please sign in to comment.