10

I am doing a POC with Spring WebFlux on Tomcat. The stack is totally reactive and using Spring Reactor and Reactive Couchbase.

When I added load on the System, I saw that the number of threads in JVisualVM increased to 200+. Basically, reactor-http threads were limited, about 4 as expected.

But http-nio-exec threads jumped to around 200. If I run with Netty instead of Tomcat the the number of threads is limited about 30 only.

Can some one explain why Tomcat is spinning up so many threads with a Reactive Stack?

0

1 Answer 1

8

Because netty has implemented an event loop mechanizm that alows for efficient handoff of incomming connections. Tomcat still uses model one thread per request.

This is a pretty intreting article on the issue:

https://kamilszymanski.github.io/resources-utilization-in-reactive-services/

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.