Error Reference

Connection pool exhausted: no available database connections

Connection pool exhausted: no available database connections

Where this appears

This error appears in the ServiceNow application logs and system diagnostics when the database connection pool reaches its maximum capacity. Users may experience slow page loads, timeouts, or complete inability to access the ServiceNow instance during peak usage or when problematic queries consume available connections.

Sourdough
Chrome Extension

Debugging this in a real instance?

Sourdough lets you trace "Connection pool exhausted: no available database connections" through system logs, script errors, and API health in the ServiceNow tab you are already using.

Add to Chrome

Free to install. Pro $5/month after a 14-day no-card trial.
Pro requires the ServiceNow admin role. Upgrade inside the extension.

Overview
Tasks
CMDB
API
Metrics
Monitor
Internals
Instance:sourdoughdev·Version:Yokohama
Instance StateONLINE
System StatusFully Operational
Session Timeout90 minutes
Logged-In Sessions2 (20 active)
Build Nameyokohama-12-18-2024_p1
IP Address10.159.128.43
Instance HealthHealth Score: 90%
🔥 5dSourdough (Chrome Plugin)Dark Mode

Cause

Long-running database queries or inefficient scripts that hold connections open for extended periods, preventing connection reuse. (high likelihood)

Sudden spike in concurrent users or automated processes overwhelming the connection pool capacity during peak usage periods. (high likelihood)

Business rules, scheduled jobs, or background scripts with database operations that fail to release connections properly due to coding errors. (medium likelihood)

Connection pool configuration set too low for the instance's actual usage patterns and user load requirements. (medium likelihood)

Database deadlocks or locking issues causing connections to remain tied up while waiting for locks to be released. (low likelihood)

Fix

Step 1: Navigate to System Diagnostics > Stats > Database and check current connection pool usage to confirm the pool is at or near maximum capacity.

Step 2: Go to System Diagnostics > Slow Queries to identify any long-running queries that may be consuming connections and note their duration and frequency.

Step 3: Check System Log > Application Log for any database-related errors or warnings that occurred around the same time as the connection pool exhaustion.

Step 4: Review active sessions at System Diagnostics > Sessions > Active to identify any hung or long-running user sessions that might be holding connections.

Step 5: Examine recent scheduled jobs and background scripts at System Definition > Scheduled Jobs to identify any that might be creating connection leaks or running longer than expected.

Step 6: If immediate relief is needed, restart the ServiceNow instance to reset all database connections, but plan for a maintenance window as this will disrupt active users.

Step 7: Review and optimize identified slow queries by adding proper indexes, rewriting inefficient GlideRecord operations, or breaking large operations into smaller batches.

Step 8: Consider requesting a connection pool size increase through ServiceNow support if usage patterns consistently exceed current pool capacity during normal operations.

Test Your Knowledge

Quick 3-question quiz. See how your ServiceNow skills stack up.

Question 1 of 3Performance

A list view on a table with millions of records is slow. Best fix?

Select an answer to continue