Backend Development 9 min read

Understanding Thread Pool Exhaustion in Dubbo: Causes and Diagnosis

The article explains that Dubbo’s zero‑capacity SynchronousQueue causes a thread‑pool “EXHAUSTED” error when incoming requests outpace consumption, often triggered by slow DB queries, lock contention, or network jitter, and that JVM stop‑the‑world pauses fill the OS TCP receive buffer, creating a post‑pause traffic burst that overwhelms the pool, with diagnostics using safepoint statistics.

DeWu Technology
DeWu Technology
DeWu Technology
Understanding Thread Pool Exhaustion in Dubbo: Causes and Diagnosis

In daily technical support, the “Thread pool is EXHAUSTED” error often appears even when monitoring shows normal process resource usage, stable traffic, and a healthy thread‑pool state.

The article first explains that Dubbo’s server thread model follows a classic producer‑consumer pattern, but the intermediate queue is a java.util.concurrent.SynchronousQueue with zero capacity, so a request that cannot be queued fails immediately.

When the network production rate exceeds the business consumption rate, the thread‑pool becomes exhausted. Typical root causes include slow DB queries, lock contention, deadlocks, network jitter, and other similar issues.

Beyond the application layer, the OS‑kernel TCP receive buffer acts as a hidden buffer between the NIC and the JVM. If the JVM temporarily stops consuming data (e.g., during a Stop‑The‑World pause), the receive buffer fills, causing a burst of data to be delivered to Dubbo once the pause ends, which can overflow the Dubbo thread pool.

The low‑level API involved is java.net.Socket#setReceiveBufSize , which configures the size of the socket receive buffer.

JVM STW can be triggered by GC or other VM operations ( VM_Operation ). The article shows how to enable safepoint statistics with the JVM options -XX:+PrintSafepointStatistics -XX:PrintSafepointStatisticsCount=1 and how to interpret the logs to detect STW events.

Finally, the article summarizes the failure path: JVM STW blocks Netty I/O, data accumulates in the socket receive buffer, the buffer is drained after STW, creating a traffic spike that exceeds Dubbo’s capacity and leads to the “Thread pool is EXHAUSTED” exception.

JVMPerformanceDubbonetworkSTWthreadpool
DeWu Technology
Written by

DeWu Technology

A platform for sharing and discussing tech knowledge, guiding you toward the cloud of technology.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.