-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MaxListenersExceededWarning with @pm2/io and express #257
Comments
We just switched from
|
If I use this: const io = require("@pm2/io").init({
metrics: {
network: true
},
}); Then I get this kind of warning. But if I dnot not use init: const io = require("@pm2/io"); Then not. I have not done a lot of testing yet, but it's either the collection of notwork metrics, or using |
for us, setting |
if i want to collect network related metrics, what should i do? is there any way to use |
Basically we only wrap the 'read' and 'write' function of the 'net' module Maybe just increasing the number of listeners allowed via |
Hi everyone,
I found that the warning is from the 'read' instead of 'write', as writing does not add listeners. pm2-io-apm/src/metrics/network.ts Lines 89 to 98 in 7b09b73
If you have some sockets that are long lasting, keep alived for a long time, in which it becomes idle and readable and idle for many times, the |
Hi I am running an small app http server with packages like
express
,pg
and@pm/io
. After I moved from pmx to@pm/io
I start getting an MaxListenersExceededWarning . I installed a plugin which will throw on the MaxListenersExceededWarning , you can find the error stack below. After I removed the @pm/io init call everything worked fine without any MaxListenersExceededWarnings.If you need more information or if I did something wrong myself, let me know.
Versions
@pm2/io: ^4.2.5
Initialization code
Error stack
The text was updated successfully, but these errors were encountered: