hamid
hamid

Reputation: 2079

Advantage of Spring boot Actuator running on different port

In Spring Boot, it is possible to have different ports for the server and management:

server.port=80
management.server.port=8081

What are the advantages and disadvantages of running Actuator (management) on different port to the server?

Upvotes: 4

Views: 414

Answers (2)

Wojciech Wirzbicki
Wojciech Wirzbicki

Reputation: 4372

When going reactive with Spring WebFlux underneath, the main difference is that Spring Runs another Netty server when server.port and management.server.port are different. In server logs it looks like below:

...
o.s.b.web.embedded.netty.NettyWebServer  : Netty started on port 8080
o.s.b.a.e.web.EndpointLinksResolver      : Exposing 2 endpoint(s) beneath base path ''
o.s.b.web.embedded.netty.NettyWebServer  : Netty started on port 8085
...

Another Netty instance ends with another EventLoopGroup for Actuator's requests. Another EventLoopGroup means completely independent thread pool and event queue for processing these requests. The main advantage is responsive /actuator/health endpoint in case of full event queue of primary EventLoopGroup.

Upvotes: 2

grekier
grekier

Reputation: 3716

Probably others but how we used it is to limit access to the actuator. i.e. we expose server.port to the web but require VPN for access to the actuator.

Upvotes: 3

Related Questions