#general

Dealing with Delay in NodeJS Integration Using PM2 Cluster Mode with Signoz

TLDR Siddhartha experienced a delay when restarting PM2 processes with Signoz. With input from vishal-signoz, they improved responsiveness by adjusting PM2 flags.

Powered by Struct AI

1

Sep 26, 2023 (2 months ago)
Siddhartha
Photo of md5-9a9f97a93acd59c979b402d44da7985d
Siddhartha
06:03 AM
In NodeJS integration, what’s the recommended way to run signoz if we’re using PM2 cluster mode? Noticed this disclaimer and we were able to get it working, however now whenever the cluster needs to be restarted, there’s significant time delay (~10s) between the time old PM2 processes were deleted and the time when new ones successfully start.

Is there a better way to ensure that we have zero-downtime deployability with signoz integration?
Image 1 for In NodeJS integration, what’s the recommended way to run signoz if we’re using PM2 cluster mode? Noticed this disclaimer and we were able to get it working, however now whenever the cluster needs to be restarted, there’s significant time delay (~10s) between the time old PM2 processes were deleted and the time when new ones successfully start.

Is there a better way to ensure that we have zero-downtime deployability with signoz integration?
Palash
Photo of md5-914a8b39b82fd99b8ecd985427660deb
Palash
08:30 AM
Prashant vishal-signoz
vishal-signoz
Photo of md5-f936d3e5743d23344d6c60813189716f
vishal-signoz
09:25 AM
Siddhartha It is recommended to import tracing.js when your app is running in PM2 mode.

We haven’t seen the delay, is the delay because of loading tracing.js?
Sep 27, 2023 (2 months ago)
Siddhartha
Photo of md5-9a9f97a93acd59c979b402d44da7985d
Siddhartha
03:35 AM
Yes, this appears to be related to loading tracing.js. The app does not become fully responsive for about 8-10 seconds, which constitutes the downtime.

For now, I’ve configured PM2 to wait for the app to become fully responsive before killing old processes, which can be done via their flags --wait-ready --listen-timeout 10000. Reference here: https://pm2.keymetrics.io/docs/usage/pm2-doc-single-page/

1