Join our Newsletter — 33% off our NHI Course
Home› FAQ› Cyber Security› What is the difference between increasing pool_size and…
Cyber Security

What is the difference between increasing pool_size and increasing queue_target in DBConnection?

← Back to all FAQ
By NHI Mgmt Group Editorial Team Updated November 23, 2026 Domain: Cyber Security

Increasing pool_size adds more active database connections, which can improve concurrency but consumes more resources. Increasing queue_target gives requests more time to wait before they are dropped, which can absorb temporary bursts without adding connections. The first changes capacity, while the second changes tolerance for waiting under load.

How pool size changes concurrency

Increasing pool_size changes how many database connections DBConnection can keep active at once. That usually raises throughput under concurrent demand because more requests can be served in parallel, but it also raises the resource footprint on both the application and the database. If the database is already near its own connection limit, a larger pool can move the bottleneck rather than remove it.

A larger pool helps most when the workload is connection-bound, not when it is waiting on slow queries, locks, or external dependencies. If each request holds a connection for a long time, adding more connections may improve headroom briefly but can also increase contention, memory use, and pressure on the database scheduler. The practical question is whether extra live connections are actually the limiting factor.

How queue_target changes waiting behavior

Increasing queue_target does not add more database capacity. It changes how long incoming requests are allowed to wait before DBConnection drops them, which makes the system more tolerant of short bursts or temporary saturation. That can smooth brief spikes, but it also increases latency for queued requests and can hide overload if the queue is allowed to grow too large.

This setting is useful when bursts are expected and brief delay is preferable to immediate failure. It is less useful if the downstream database is persistently overloaded, because longer waiting time does not create more throughput. In that case, a larger queue can simply defer rejection while users experience slower responses and the backlog grows.

Choosing between more capacity and more tolerance

The key difference is that pool_size changes the amount of work the system can handle in parallel, while queue_target changes how gracefully it behaves when demand briefly exceeds that capacity. One affects steady-state throughput, the other affects burst handling and drop behavior. If the service is under constant pressure, capacity is the issue; if the problem is short-lived spikes, queue tolerance may be the better lever.

These knobs also interact. Raising queue_target without enough connection capacity can make users wait longer without improving completion rate, while raising pool_size without considering database limits can increase contention or exhaust resources. The right setting depends on whether you want to serve more concurrent requests or absorb short bursts without immediate rejection.

Practitioner Guidance

What to verify: Check whether failures are caused by connection starvation, slow query execution, or downstream database limits before changing either setting. If waits are brief and spikes are the issue, a modest queue increase may be enough; if requests are consistently backed up, you need more capacity or faster queries, not a longer queue.

Decision rule: Increase pool_size when the database has spare headroom and requests are blocked by lack of available connections. Increase queue_target when you want to absorb short bursts without dropping requests, but only if the added wait time is acceptable for the user experience.

Practitioner takeaway: Treat pool_size as a throughput control and queue_target as a burst-tolerance control, and avoid using one to compensate for a bottleneck in the other.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on November 23, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org