Spring Downloading Tomcat Native Performance

I am developing the Microservices API for my application. I started with the spring boot application. I created two artifacts, such as "business code with built-in tomcat and " business code without built-in tomcat .

When I compare performance results, I see "not built-in tomcat" (ie, running on stand-alone tomcat) gives a good result due to native execution.

So basically what is the difference between inline tomcat and standalone tomcat? in the implementation of the wise.

How does performance change between two executions?

Regards, Peter

+4
source share
1 answer

I found the cause of this problem.

APR (Apache Portable Runtime) plays an important role in running tomcat threads.

By default, the built-in tomcat runs NIO. NIO and BIO were made based on Java, where APR is still the usual execution. When we compare the performance of NIO and APR; APR is much faster.

Virtually all of the basic Tomcat Linux packages come with APR libraries under the tomcat lib folder.

After I turned on APR in the built-in tomcat (i.e. Spring Boot), the performance was the same as that of the stand-alone tomcat.

http://tomcat.apache.org/tomcat-7.0-doc/apr.html

+6
source

Source: https://habr.com/ru/post/1659264/


All Articles