> Markdown version of [/events/conference-india-2026/sessions/1987-how-we-cut-our-api-s](https://www.wearedevelopers.com/events/conference-india-2026/sessions/1987-how-we-cut-our-api-s). Every page supports `.md` or `Accept: text/markdown`. Links point to the HTML versions so they work for humans too. Agent guide: [/agents.md](https://www.wearedevelopers.com/agents.md). --- # How We Cut Our API's p99 Latency from Minutes to Under a Second - **Event:** Conference India 2026 ## Description Six months ago, the most critical API in our platform had p99 latency that regularly spiked into minutes. Our primary database CPU was at capacity. Customers were timing out. We were three engineers staring at dashboards full of red. This talk is the story of how we traced that meltdown to six compounding failures — and fixed all of them. Not one silver bullet, but six layers of the stack quietly making each other worse. I'll walk through each failure and the fix, with real metrics: Queries running without statement_timeout — a single slow scan holding connections for 90+ seconds while the pool starved CompletableFuture.supplyAsync() on Java's shared ForkJoinPool — blocking JDBC calls saturating 11 threads and silently losing our @ReadOnly ThreadLocal, routing every read to the primary while the replica sat idle Composite indexes on the wrong column order, dead JOINs the ORM added that the query never needed, and aggregations spilling to disk A cache miss thundering-herd that turned a cold restart into a self-inflicted DDoS For each one, I'll show the before-and-after: the EXPLAIN ANALYZE output, the thread dump, the Grafana panel. I'll demo a set of regex patterns we now run in CI to catch these anti-patterns before they reach production. You'll leave with a checklist of ten things to audit in your own Spring Boot + PostgreSQL services tonight — and the grep commands to do it. ## Speaker ### [Deepak Agrawal](https://www.wearedevelopers.com/@deepak-agrawal) PRINCIPAL SOFTWARE ENGINEER at ATLASSIAN ## Related talks at this congress - [We Deleted Our Observability Stack and Rebuilt It with OTEL: 12 Engineers to 4 at 20K+ clusters](https://www.wearedevelopers.com/events/conference-india-2026/sessions/1998-we-deleted-our) — Yash Sharma - [What I Got Wrong Shipping an MCP Server for Live Infrastructure](https://www.wearedevelopers.com/events/conference-india-2026/sessions/1999-what-i-got-wrong) — Pritesh Kiri - [Shipping MCP to Real Users: Scaling, Auth, and the PII Leak You Didn't See Coming](https://www.wearedevelopers.com/events/conference-india-2026/sessions/1993-shipping-mcp-to-real) — Hadar Geva - [From Profiler to Production: Measuring What Actually Matters in React & React Native](https://www.wearedevelopers.com/events/conference-india-2026/sessions/1983-from-profiler-to) — Andrei Tazetdinov ## Watch remotely Can’t make it to Bengaluru? Watch this session live with Pro. You also get: - All full videos, bookmarks, and playlists - World Congress livestreams [See pricing](https://www.wearedevelopers.com/pricing) ## Links - [Get tickets](https://www.wearedevelopers.com/conference-india/tickets)