GithubHelp home page GithubHelp logo

EMFILE: too many open files about bree HOT 10 CLOSED

breejs avatar breejs commented on May 15, 2024
EMFILE: too many open files

from bree.

Comments (10)

r00b avatar r00b commented on May 15, 2024 2

Specifically I believe the issue was that as Node worker threads exited they did not necessarily flush their file streams, thus when the number of open file streams exceeded ulimit, the parent process crashed. I think.

from bree.

shadowgate15 avatar shadowgate15 commented on May 15, 2024 2

@alvin30595 I would suggest using the workerMessageHandler and do the logging work on the main process. Worker threads and logging is pretty difficult.

from bree.

ErisDS avatar ErisDS commented on May 15, 2024 1

@r00b thank you so much!

from bree.

r00b avatar r00b commented on May 15, 2024

I've seen solutions ranging from installing watchman to just setting the ulimit -n to a higher int (although mine is already 10240) but I'm unsure if these are correct since they are machine-based solutions, and when my application runs in a different machine I don't want it to have the same problem.

from bree.

niftylettuce avatar niftylettuce commented on May 15, 2024

Not sure what the redis-service contents are? But yes, it's common practice to even increase this on servers.

We do this on Forward Email out of the box with our ansible config:

https://github.com/forwardemail/forwardemail.net/blob/2108d0b2db10295748996431263fbde16584a615/ansible/playbooks/security.yml#L169-L175

from bree.

r00b avatar r00b commented on May 15, 2024

Turns out this was an issue regarding how winstonjs/winston-daily-rotate-file works within worker threads. Spoiler alert, it doesn't work very well. Thanks for putting up with all of my non-issue issues.

from bree.

ErisDS avatar ErisDS commented on May 15, 2024

@robertsteilberg Think we may have hit the same issue but with bunyan - how did you resolve it? Was it purely not using logging in the worker thread or something else?

from bree.

ErisDS avatar ErisDS commented on May 15, 2024

@r00b would be really helpful if you could share some more details please

from bree.

r00b avatar r00b commented on May 15, 2024

Hi @ErisDS, apologies for late reply, I am on vacation this month. Unfortunately I found no way to resolve this without moving away from winstonjs/winston-daily-rotate-file and avoiding a logging service that involves writing files to disk--this seems to be an issue with Node worker threads, not Bree, I think. It has been awhile since I was deep in this though. In the end I found that maintaining logs by writing to files was not the best option for me anyway, seems that using services to capture logs and keep them in a platform somewhere was a better option.

from bree.

alvinlys avatar alvinlys commented on May 15, 2024

if that the case, what logger you used to replace winston? Mind to share your alternative? Thanks

Hi @ErisDS, apologies for late reply, I am on vacation this month. Unfortunately I found no way to resolve this without moving away from winstonjs/winston-daily-rotate-file and avoiding a logging service that involves writing files to disk--this seems to be an issue with Node worker threads, not Bree, I think. It has been awhile since I was deep in this though. In the end I found that maintaining logs by writing to files was not the best option for me anyway, seems that using services to capture logs and keep them in a platform somewhere was a better option.

from bree.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.