-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Use Tomcat APR connector for performance improvements #7376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I think @bclozel may have been looking into this a little. It would be nice if we could somehow make this easier. |
@philwebb Do you required any information from my side to continue further ? |
This is also related to using native libs for TLS support, which is very handy for http/2 support. Quick questions @PeterJerald:
|
@bclozel Please find below for my answers
If we enable under application common location that help us.
Currently I kept along with application and I have added -Djava.library.path path variable in JVM. If we kept under OS also fine.
Yes. By default tomcat native lib(8 +) requires; OpenSSL 0.9.7+, so i have installed in OS |
I guess it should work similarly to how |
@PeterJerald are there some benchmark results comparing NIO and APR based applications? |
https://gist.github.com/andreldm/7f89a3279438467a0bd41e6c1249d014 Please refer above sample program to enable APR in spring boot. |
@iNikem we tested with business logic code and compared the results. let me try with sample code |
It doesn't look like using the APR connector is a good idea because:
However, enabling the use of tomcat-native/APR so the OpenSSL implementation is available to the non-APR connectors is a good idea (see the benchmarks in the aforementioned pdf). Notably, enabling APR also allows for the use of http/2. |
Adds AprLifecycleListener to the Tomcat listeners. Fixes spring-projects#7376
Closing this issue, see #10079 (comment). We will consider tomcat-native for the TLS use case in #10043. |
nice |
https://gist.github.com/andreldm/7f89a3279438467a0bd41e6c1249d014 - This link seems to be broken. Are there other examples for enabling APR in spring boot |
Uh oh!
There was an error while loading. Please reload this page.
In apache tomcat uses apache portable runtime(APR) to provide better performance and scalability with native execution. APR uses system resources and execute natively. If we compare the execution performance BIO , NIO and APR connectors APR provides superior performance.
I have experience the same in my development phase. I created two sets of artifacts which is standalone Jar with spring boot embedded tomcat and spring boot war file and deployed on "tomcat" both are same code base but APR configuration is only difference.
Spring boot by default all the threads execution based on “NIO”, so I have compiled APR libraries based on below link:-
https://tomcat.apache.org/tomcat-8.0-doc/apr.html
Executed Spring Boot Jar file with APR. Now I can see performance results are exactly same.
In our spring boot documentation does not have APR guide to add in embedded tomcat. If we add it will help other developers as well.
The text was updated successfully, but these errors were encountered: