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

Pages should watch themselves #14

Open
ghost opened this issue Sep 16, 2011 · 2 comments
Open

Pages should watch themselves #14

ghost opened this issue Sep 16, 2011 · 2 comments
Assignees
Milestone

Comments

@ghost
Copy link

ghost commented Sep 16, 2011

Original Title: Too many files open

When there are many files opening because of the rendering of a webpage it throws up this error :

if (err) throw err;
^
Error: EMFILE, Too many open files

@jxson
Copy link
Owner

jxson commented Sep 17, 2011

When you get a chance can you add what your current kern.maxfiles setting is by running:

sysctl -a | grep files 

Or something similar, also add how many files are in the project you are working on:

ls -1R | grep .*. | wc -l

I have a feeling this is related:
http://groups.google.com/group/nodejs/browse_thread/thread/e4c8ca9430dafc53

Or I have a really serious bug...

@jxson
Copy link
Owner

jxson commented Sep 19, 2011

we found the problem in nratan's project and solved it, it will be a problem for others and should be fixed within haiku to prevent head scratching and frustration.

He was looping over about 100 posts that all had exerts with image tags with a src attribute that didn't exist yet, when the browser tried to load these each request went to the haiku server which attempted to reload itself for each image at about the same time causing the "Error: EMFILE, Too many open files" error to occur.

Two things should happen:

  1. the main haiku object shouldn't reload itself on every request, each piece of content should be aware of changes to it's file and update itself accordingly using fs.watchFile http://nodejs.org/docs/v0.4.12/api/all.html#fs.watchFile this will greatly reduce the amount of file reads and work that needs to be done to provide the updated content
  2. we should keep an eye on the amount of open files and queue file reads in a way that we never hit the kern.maxfiles limit as suggested here: http://groups.google.com/group/nodejs/browse_thread/thread/e4c8ca9430dafc53

@ghost ghost assigned jxson Sep 27, 2011
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

1 participant