meloncholy / vid-streamer

VidStreamer.js: A simple streamer for Flash and HTML5-style videos. Supports HTTP pseudostreaming and works with JW Player's bitrate switching.
http://meloncholy.com
384 stars 64 forks source link

Error: EMFILE: too many open files happened #33

Open poppop0911 opened 7 years ago

poppop0911 commented 7 years ago

Error: EMFILE: too many open files happened

 return stream.pipe(res);

Maybe change to below code can resolve this problem https://github.com/jshttp/on-finished

stream.pipe(res)
   onFinished(res, function (err) {
   destroy(stream)
});

take this load test for this case

./wrk -c 200 -d 30 -t 12 -v http://localhost:9000/0e16c56a28a4ea5aa7b6d40b09ce1b9b.mp4