1
votes

I am using spring boot 2.0.4.RELEASE. My doubt is whether my application is running in event loop style or not. I am using tomcat as my server.

I am running some performance tests in my application and after a certain time I see a strange behaviour. After the request reaches 500 req/second , my application is not able to serve more than 500 req/second. Via prometheus I was able to figure out max thread for tomcat were 200 by default. Looks like all the threads were consumed and that's why , it was not able to server more than 500 req/second. Please correct me if am wrong.

Can the tomcat server run in event-loop style ? How can I change the event-loop size for tomcat server if possible.

Tried changing it to jetty still the same issue. Wondering if my application is running in event loop style.

2
I'm pretty new to this and can't answer your question, but hope this link might help you kamilszymanski.github.io/… - kojot

2 Answers

0
votes

Hey i think that you are doing something wrong in your project maybe one of your dependency does not support reactive programming. If you want to benefit from async programing(reactive) your code must be 100 reactive even for security you must use reactive spring security. Normally a reactive spring application will run on netty not in tomcat so check your dependency because tomcat is not reactive

-1
votes

This is more of a analysis. After running some performance test on my local machine , I was able to figure out what was actually happening inside my application.

What I did was, ran performance test on my local machine and analysed the application through JConsole.

As I said I scheduled all my blocking dB calls to schedulers.elastic. What I realised that I it is causing the bottleneck. since my dB connections are limited and I am using hikari for connection pooling so it doesn’t matter the number of threads I create out of elastic pool. Since reactive programming is more about consuming resource to the fullest with lesser number of threads, since the threads were being created in unbounded way so it was no different from normal application .

So what I did as part of resolution limited the number of threads to 100 that were supposed to be used by for dB calls. And bang number jumped from 500 tps to 2300 tps.

I know this is not the number which one should expect out of reactive application , it has much more capability. Since right now I do not have any choice but to bear with non reactive drivers .Waiting for production grade availability of reactive drivers for mssql server.