doctl Verified current stable Not installed? Cloud Infrastructure

Doctl / Create Connection Pool For Database

Create Connection Pool For Database

Create a new connection pool for a specified database.

$
Terminal
doctl d p c <database_id> <pool_name> --db <new_pool_name> --size <pool_size>

When To Use

When scaling database access for high-traffic application components.

Pro Tip

For optimal performance, monitor the pool size in relation to application load and adjust accordingly post-creation.

Command Builder

Tune the command before you copy it

Back to syntax
$
Generated Command
doctl d p c <database_id> <pool_name> --db <new_pool_name> --size <pool_size>

Anatomy of Output

Understanding the result

Creating pool: new-connection-pool in Database ID: 567890 Creation Status

Indicates the creation command execution.

Pool Size: 10 Configured Size

Confirms the number of connections configured for the pool.

Database ID: 567890 Database Identifier

Identifier of the database for which the pool is created.

Power User Variants

Optimized versions

doctl databases pool create 567890 new-connection-pool --db new-db-name --size 5

Create with a different database name.

doctl databases pool create 567890 new-connection-pool --size 20 --allow-scaling

Allow scaling of the connection pool automatically.

Troubleshooting

Common pitfalls

Error: Invalid database ID provided during pool creation.

Solution: Verify the database ID exists and is active.

Error: Pool name already in use.

Solution: Choose a different name for the new connection pool.

Error: Pool size must be a positive integer.

Solution: Specify a positive number for pool size.

Command Breakdown

What each part is doing

doctl
Base Command
The executable that performs this operation. Here it runs Doctl before the shell applies any redirect operators.
d
d|databases
The value supplied for d|databases.
p
p|pool
The value supplied for p|pool.
c
c|create
The value supplied for c|create.
<database_id>
database id
The value supplied for database id.
<pool_name>
pool name
The value supplied for pool name.
<new_pool_name>
new pool name
The value supplied for new pool name.
<pool_size>
pool size
The value supplied for pool size.
--db
Command Option
Tool-specific option used by this command invocation.
--size
Command Option
Tool-specific option used by this command invocation.

Alternative Approaches

Comparable commands in other tools

Alternative cloud infrastructure tools for the same job.