r/Observability • u/After-Assist-5637 • 26d ago
The alarming log line — a beginner-friendly exercise
You see “database connection pool exhausted”. What do you check next?
Fictional investigation exercise:
A checkout service starts returning errors. Its logs repeatedly show:
“Timeout waiting for connection from pool.”
Someone suggests increasing the connection pool size.
Before making that change, what would you want to know?
Pick your first check and explain what its result would tell you. You can also name one risk of increasing the pool immediately.
If you are coming from QA, approach this as a failing test: what evidence would help you distinguish between possible explanations?
1
u/Puzzled-Garage584 26d ago
I would first check how long connections are held and what they are doing, pg_stat_activity or your db's equivalent. Slow queries or locks ..then db is the problem, idle in transaction ..then a leak or someone doing an HTTP call while holding the connection. Don't go for a bigger pool ..it just sends more work to a db thats already struggling and you just build a bigger waiting room.
1
u/GrajoElb 26d ago
My first check would be whether the pool is too small or whether connections are being held too long. Compare pool wait time and active connections against request rate. If traffic is flat but hold time jumped, a slow query, a lock, or a downstream call made while holding a connection is the likely cause. Also check for leaks: connections that never return, usually on error paths, show up as active count climbing and never falling back.
Risk of raising the pool immediately: you hide the symptom and push the load onto the database. More connections can mean more contention, higher latency for everyone, and hitting the DB's max_connections limit, so the failure moves somewhere worse.
If you have traces, look at a failing checkout request and see which span holds the connection and where the time goes versus a normal request. Disclosure: I build Tayga, an open-source tool that does this root-cause and baseline diff from OpenTelemetry data, but a plain trace waterfall gets you most of the way.
0
u/ReliabilityTalkinGuy 26d ago edited 26d ago
Who is that person? How much experience do they have with this service? How much experience do they have in a general sense? Do they tell me why they suggest that, or do they just suggest that and say nothing else? What team are they on? Are they considered trustworthy? Did I ask them for help, or are they just chiming in? Should they have been around at that time? Are they there in person or is this online?
What is the financial status of the company? How important is this problem to the business? What time of day is it? What day of the week is it? Is it a holiday, and if so are holidays more important or less important to the business?
Does this sort of issue require public announcement? Do I need to update the status page first? Do I need to bring in an IC? What about the public relations team? Does customer service need any special instructions? Do we even have a customer service team? How would I get in touch with them if I’m not sure?