
Virtual Threads in Real Production: Docker, Kubernetes, and What the Dashboards Don't Tell You
Series: Java in Real Production — This is the second article of the series. If you haven't read the first one yet, it covers the fundamentals of Virtual Threads, Thread Pinning, and the Stampede Effect — concepts we'll build on here. Read Part 1 here — Virtual Threads in Java 21: The End of the Scarcity Era (and the Pitfalls That Can Take You Down) . You read about Virtual Threads. You understood the mental model. You fixed Thread Pinning, put a Semaphore in front of the database. The application is working in development. Then you deploy. And the weirdness begins: latency spiking for no apparent reason, container being killed by the kernel at peak hours, dashboards showing low CPU while requests pile up in the queue. Everything seems fine — until it isn't. This article is about what happens after the deploy. The production environment — Docker, Kubernetes, and observability — has its own pitfalls for Virtual Thread applications, and most of them are invisible until it's too late. Stac
Continue reading on Dev.to
Opens in a new tab



