pugjs / pug

Pug – robust, elegant, feature rich template engine for Node.js
https://pugjs.org
21.7k stars 1.95k forks source link

Error: EMFILE, too many open files #1600

Closed Cyberuben closed 10 years ago

Cyberuben commented 10 years ago

image

I'm constantly getting the following error. I do not run anything special and neither do I use fs anywhere. My website has the following modules, all up to date: image

I'm not sure if this has been reported before but I could not find it.

I'm running Node v0.10.29 on CentOS 6.4. If additional information is required I'll gladly provide it.

To render pages, I use res.render(filename, options), nothing special or overwritten.

ForbesLindesay commented 10 years ago

I would try looking at http://stackoverflow.com/a/21070580/272958

My guess is that you're leaking file handles somewhere because jade doesn't open very many file handles. I also not ethat it looks like the error occurs while rendering error.jade. Perhaps try removing your error handling/reporting code so that you just get the original error instead. You may find that that gives you clues as to what's going on.

Cyberuben commented 10 years ago

It seems like you were right, I'm sorry!

I use the "SourceQuery" module to count how many players are currently on my test server. Unfortunately, the script does not close the connection after opening it. So the result of this: Image

Either way, problem is now solved. I'm sorry for being at fault!

ForbesLindesay commented 10 years ago

No problem, glad I was able to help find a solution.