Hi Bert, I was getting a bunch of different errors: node: ../src/tcp_wrap.cc:353: static void node::TCPWrap::AfterConnect(uv_connect_t*, int): Assertion `req_wrap->object_.IsEmpty() == false' failed. Unknown system errno 105 (node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit. (never had these before)
The app wasn't using excessive memory or CPU, but it would respond to requests really slowly or not at all. Monit would start it, it would run for ~2-10 seconds, then crash with one of the first two above. During that time I tried to do a 'git pull' which led to warnings about the socket send buffer being full, and led me down this path. But on second thought, I think I jumped to that conclusion too quickly. I just checked our nofile limits and they were set at 1024 so it's definitely possible we ran out of file descriptors. Thanks, Michael On Wednesday, October 10, 2012 8:37:20 PM UTC-4, Bert Belder wrote: > > > > 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
