简体   繁体   中英

how to find the load on a spring boot application?

i have multiple spring boot apps running, and I'm creating a load balancing controller of some sort,
is there a way to find out which nodes are loaded more than others, loaded meaning with running sessions, or requests.

You can use metric based monitoring for that. Depending on your context you can use the provided infrastructure of your cloud provider or hosting provider.

if you operate the nodes yourself you can use the opensource solution https://prometheus.io/ with node_exporter for machine metrics. Spring actuator provides prometheus metrics export with https://micrometer.io/ and if a metric, like number of sessions, is missing, you can easily extend it with your own metrics.

The Spring Boot Production Ready Features , aka Actuator, provides various metrics such as CPU usage, JVM stats, latencies, sessions, Spring MVC and WebFlux metrics, etc that are backed by Micrometer. The metrics can then be further integrated with various metrics systems such as JMX, DataDog, Prometheus, New Relic to name a few.

Please read the Micrometer: Spring Boot 2's new application metrics collector blog post and the Spring Boot Actuator Web API Documentation for more information.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM