'Performance issue with upgrade of spring boot

We upgraded an spring boot app from 2.0.0.RELEASE to 2.5.5. We use spring integration with queues persisted in Postgresql. We expose API. The embedded server is Tomcat. Unfortunately we had performance issue. We confirmed that it comes from the upgrade, because the issue gone after rollback to 2.0.0.RELEASE.

We took a look at Hot spots method for CPU with visualvm :

Hot spots - method for CPU with visualvm

Spring boot 2.0.0.RELEASE version uses Tomcat 8.5 and the 2.5.5 uses 9.0. We will probably give a try to use Undertow instead of Tomcat and see what happends...

Is any known issue about spring boot upgrade? I don't see any related performance issue on github for spring boot : https://github.com/spring-projects/spring-boot/issues?q=is%3Aissue+is%3Aopen+performance+label%3A%22theme%3A+performance%22

related unresolved stackoverflow posts : Spring Boot Version Upgrade Performance Issue Spring Data performance issues after upgrade spring-boot-1.5.20 -> spring-boot-2.1.4 Performance issues with Spring Boot 2.x?



Solution 1:[1]

This problem appeared exactly in Spring Boot 2.5.0

As per release notes:

Spring Integration now reuses an available TaskScheduler rather that configuring its own. In a typical application setup relying on the auto-configuration, this means that Spring Integration uses the auto-configured task scheduler that has a pool size of 1. To restore Spring Integration’s default of 10 threads, use the spring.task.scheduling.pool.size property.

See https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.5-Release-Notes

So once I changed pool size back to 10 I could see the same level of performance as before Spring Boot upgrade.

Hope this helps

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1