Skip to content
Cloudflare Docs

Limits

The following limits apply to Hyperdrive configurations, connections, and queries made to your configured origin databases.

Configuration limits

These limits apply when creating or updating Hyperdrive configurations.

LimitFreePaid
Maximum configured databases10 per account25 per account
Maximum username length 163 characters (bytes)63 characters (bytes)
Maximum database name length 163 characters (bytes)63 characters (bytes)

Connection limits

These limits apply to connections between Hyperdrive and your origin database.

LimitFreePaid
Initial connection timeout15 seconds15 seconds
Idle connection timeout10 minutes10 minutes
Maximum origin database connections (per configuration) 2~20 connections~100 connections

Hyperdrive does not limit the number of concurrent client connections from your Workers. However, Hyperdrive limits connections to your origin database because most hosted databases have connection limits.

Connection errors

When Hyperdrive cannot acquire a connection to your origin database, you may see one of the following errors:

Error messageCause
Failed to acquire a connection from the pool.The connection pool is exhausted because connections are held open too long. Long-running queries or transactions are a common cause.
Server connection attempt failed: connection_refusedYour origin database is rejecting connections. This can occur when a firewall blocks Hyperdrive, or when your database provider's connection limit is exceeded.

For a complete list of error codes, refer to Troubleshoot and debug.

Query limits

These limits apply to queries sent through Hyperdrive.

LimitFreePaid
Maximum query (statement) duration60 seconds60 seconds
Maximum cached query response size50 MB50 MB

Queries exceeding the maximum duration are terminated. Query responses larger than 50 MB are not cached but are still returned to your Worker.

Request a limit increase

You can request adjustments to limits that conflict with your project goals by contacting Cloudflare. Not all limits can be increased.

To request an increase, submit a Limit Increase Request form. You can also ask questions in the Hyperdrive channel on Cloudflare's Discord community.

Footnotes

  1. This is a limit enforced by PostgreSQL. Some database providers may enforce smaller limits. 2

  2. Hyperdrive is a distributed system, so a client may be unable to reach an existing pool. In this scenario, a new pool is established with its own connection allocation. This prioritizes availability over strict limit enforcement, which means connection counts may occasionally exceed the listed limits.