Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add ability to disable connection-pooling behavior for Dynamic Backends #574

Merged
merged 2 commits into from Jul 11, 2023

Conversation

JakeChampion
Copy link
Contributor

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.

Copy link
Contributor

@elliottt elliottt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking great! Do you need to update register_dynamic_backend in host_api.cpp as well?

@JakeChampion JakeChampion force-pushed the jake/dont-pool-option branch 2 times, most recently from fc594fc to 8363d51 Compare July 11, 2023 10:00
@JakeChampion
Copy link
Contributor Author

This is looking great! Do you need to update register_dynamic_backend in host_api.cpp as well?

You are right, yes -- that has now been updated 👍

Copy link
Contributor

@elliottt elliottt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

backend_config_mask |= BACKEND_CONFIG_USE_SSL;
if (config->ssl_min_version.is_some)
}
if (config->dont_pool.is_some && config->dont_pool.val) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch here!

…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.
@JakeChampion JakeChampion merged commit 718bea8 into main Jul 11, 2023
81 checks passed
@JakeChampion JakeChampion deleted the jake/dont-pool-option branch July 11, 2023 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants