It is a fairly common pattern to expose some endpoints on a separate port, e. g. for healthchecks and metrics. The only way to do that in fastify is by running a second instance of fastify with just these endpoints exposed.
Are there any good reasons not to do so? Are there any non-trivial performance losses due to a second instance of fastify running? Or it only generates as much load as the traffic that it receives and hence doesn't change anything over just serving same traffic over single instance, sans the memory usage of double the amount of internal app entities?
Note that we are talking about a heavy load system.
(happy to document this info afterwards)
It is a fairly common pattern to expose some endpoints on a separate port, e. g. for healthchecks and metrics. The only way to do that in fastify is by running a second instance of fastify with just these endpoints exposed.
Are there any good reasons not to do so? Are there any non-trivial performance losses due to a second instance of fastify running? Or it only generates as much load as the traffic that it receives and hence doesn't change anything over just serving same traffic over single instance, sans the memory usage of double the amount of internal app entities?
Note that we are talking about a heavy load system.
(happy to document this info afterwards)