Splunk DB Connect ↔ External Database: diagnosing intermittent connection pool exhaustion
0 reputation · 04 Apr 2020, 18:10 UTC
0 reputation · 04 Apr 2020, 18:10 UTC
Identify the root cause of sporadic “Connection is not available” errors reported by Splunk DB Connect while querying an external database.
Errors appear only under high search concurrency; logs show timeouts but lack clarity on whether the pool is saturated, a network hiccup, or a database lock.
DB Connect’s pool metrics are exposed only via JMX or an undocumented REST endpoint; it is unclear how reliable these are for production monitoring.
33275 reputation · 05 Apr 2020, 04:45 UTC
When Splunk DB Connect logs Connection is not available during periods of high search concurrency, the most common cause is that the HikariCP pool has reached its maxConnections limit and threads are timing out while waiting for a free connection. A genuine network glitch or database lock will usually surface with a different SQLState or with a lower ActiveConnections count.
com.zaxxer.hikari:type=pool (HikariPool‑#). The attributes ActiveConnections, IdleConnections, MaxConnections, and ThreadsAwaitingConnection are read‑only and do not require DEBUG logging.
/services/dbx/dbx2/pool/ on the Splunk management port returns a JSON payload containing the same fields as the JMX bean. The endpoint is available in all recent 3.x releases, but because it is not officially documented, future versions might modify or remove it.
In practice the endpoint has been stable across the last two major releases of DB Connect (3.1 and 3.2). It is safe to use for dashboards and alerting as long as the script can fall back to JMX if the endpoint is missing or changes. The Splunk support team recommends keeping the fallback in place because the endpoint is not part of the public API contract.
ThreadsAwaitingConnection and a steady rise in ActiveConnections that reach MaxConnections with the timestamps of the “Connection is not available” errors. If the pattern matches, the error is almost certainly due to pool saturation.
ActiveConnections well below MaxConnections but errors still occur, look for SQLState 08xxx (network reset) or long lock waits on the database side. Check firewall idle‑timeout settings and the database’s wait‑queue or lock‑monitoring tools.
maxConnections setting for the specific database input, ensuring the new value stays comfortably below the database server’s own connection limit. If saturation persists, investigate whether scheduled searches can be staggered or if query runtimes can be shortened.
Could you provide the exact maxConnections value configured for the database input that is throwing the error? Knowing that number lets us determine whether the pool size is appropriate for the observed concurrency level.
This guidance assumes a Splunk Enterprise instance running DB Connect 3.x on a supported JVM. The exact default values for maxConnections and the connection timeout vary by database type and by the specific input configuration, so the recommendation to increase the pool size is tentative until those values are known.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.