Skip to content
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

pm2 has too many open files? #603

Closed
mattcasey opened this issue Jul 30, 2014 · 3 comments
Closed

pm2 has too many open files? #603

mattcasey opened this issue Jul 30, 2014 · 3 comments

Comments

@mattcasey
Copy link

My app was restarting every 10 minutes or so for the past 12 hours with no error and very low CPU/memory usage, then I recently got this error from winston:

Error: EMFILE, too many open files

however running lsof showed that the culprit was pm2. I could see the following repeated a hundred times? or so. I'm just looking to see if you can help determine in what situation pm2 would not close the file so that I can avoid it in the future!

node      29520      ubuntu  965w      REG              202,1  2791568   413813 /home/ubuntu/.pm2/logs/receiver-err-0.log
node      29520      ubuntu  966w      REG              202,1 20320184   413812 /home/ubuntu/.pm2/logs/receiver-out-0.log
node      29520      ubuntu  967w      REG              202,1  2791568   413813 /home/ubuntu/.pm2/logs/receiver-err-0.log
... 

We do a lot of pm2 restarts 'app name'. The pid 29520 is not pm2 itself, but the process of my script that is maintained by pm2. Doing 'pm2 kill' cleared out the open files. node: v0.10.29, pm2: 0.9.1

@Unitech
Copy link
Owner

Unitech commented Jul 30, 2014

This is fixed with the latest pm2 version
On Jul 30, 2014 9:32 PM, "Matt Casey" notifications@github.com wrote:

I recently got this error from winston:

Error: EMFILE, too many open files

however running lsof showed that the culprit was pm2. I could see the
following repeated a hundred times? or so. I'm just looking to see if you
can help determine in what situation pm2 would not close the file so that I
can avoid it in the future!

We do a lot of pm2 restarts 'app name'. The pid 29520 is not pm2 itself,
but the process of my script that is maintained by pm2. Doing 'pm2 kill'
cleared out the open files. node: v0.10.29, pm2: 0.9.1

node 29520 ubuntu 965w REG 202,1 2791568 413813 /home/ubuntu/.pm2/logs/receiver-err-0.log
node 29520 ubuntu 966w REG 202,1 20320184 413812 /home/ubuntu/.pm2/logs/receiver-out-0.log
node 29520 ubuntu 967w REG 202,1 2791568 413813 /home/ubuntu/.pm2/logs/receiver-err-0.log
node 29520 ubuntu 968w REG 202,1 20320184 413812


Reply to this email directly or view it on GitHub
#603.

@mattcasey
Copy link
Author

Allright, thanks! good to know

@Unitech
Copy link
Owner

Unitech commented Jul 30, 2014

Just to be sure, your processes was in fork mode ?
On Jul 30, 2014 9:36 PM, "Matt Casey" notifications@github.com wrote:

Closed #603 #603.


Reply to this email directly or view it on GitHub
#603 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants