On Wednesday, October 10, 2012 6:29:51 PM UTC+2, Michael Nutt wrote: > > I'm in a situation where I'm serving a handful of 1MB static files to > clients. We have our logic that determines which file to serve in node, so > putting nginx or varnish in front of our node app isn't a great solution. > Our first naive attempt was to load the entire file into a Buffer and cache > each one for 60 seconds, and when a client connected we would just > res.end(buffer).
That sounds like a great way to do it. I would stick to it if you can. This worked fine up until yesterday, when a small number of slow clients > caused our app to fall over due to what I think was the kernel send buffer > filling up. > That doesn't sound very plausible. The kernel send buffer fills up all the time; node takes care of handling that. I think it is more likely that you ran out of file descriptors. If you are on linux (or another unix-like OS) and you haven't done so already, try to up it with "ulimit". How did the the app "fall over"? Did it crash with an error? Did it just stop serving files? Spin? Crash? - Bert -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en
