Adrian Smith
Adrian Smith

Reputation: 71

Spring-boot 2.2.x increased CPU

We have a Spring-boot REST application running on 3 production machines. A recent update from Spring-boot 2.1.8 to 2.2.2 has shown an initial increase of CPU by at least double. This load then increases over time whereas the old version stays steady.

I have managed to narrow this down to 2.2.x as building with 2.1.11 is ok, but 2.2.0 shows the problem.

To give an idea of scale, the old version stays at around 6% regardless of load, whereas the new version starts at around 15% and gradually increases to over 100% after about 10 hours.

I can see the initial rise with an identical build, only changing the Spring-boot version. The application uses spring-boot-starter-web and spring-boot-starter-actuator.

Any ideas? Should I raise this over at https://github.com/spring-projects/spring-boot/issues ?

Upvotes: 4

Views: 2450

Answers (2)

Brian Clozel
Brian Clozel

Reputation: 59191

This is very likely to be linked to a bug in Spring Framework that was fixed in Spring Framework 5.2.6 (or Spring Boot 2.2.7). There was a memory leak in case of concurrent requests/responses with the same media type.

See the dedicated issue as well as a report sent by a developer with lots of details. Note that this happens with both MVC and WebFlux.

Upvotes: 2

wayno93
wayno93

Reputation: 51

We've seen this issue in some of our services, but upgrading to 2.2.7 looks to have resolved this for one (stable for two weeks).

We're starting to roll this out to more services in the hope that it can be rolled out everywhere, so might be worth trying this out?

Upvotes: 1

Related Questions