DEV Community

David Brown
David Brown

Posted on • Originally published at tucanoo.com

Virtual Threads in Spring Boot 4: I rewrote a blocking service and measured everything

I took one realistic blocking Spring Boot 4 service — a PostgreSQL query through HikariCP plus a downstream HTTP call — flipped spring.threads.virtual.enabled=true, and benchmarked exactly what changed: throughput, tail latency, and where the bottleneck went.

TL;DR: ~6× throughput at 2,500 concurrent users from one flag — but the connection pool quietly becomes your new ceiling, so you have to resize it. I also measured the JEP 491 pinning change (the "avoid synchronized" advice is now out of date).

Full write-up, raw data, charts and a reproducible repo on the Tucanoo blog

👉 https://tucanoo.com/virtual-threads-in-spring-boot-4

Top comments (0)