Loopbusy
Middleware to send 503s and keep your server alive when it's too busy to queue more requests.
var app = ; app ;
Loopbusy uses the event-loop-lag module to determine when the event loop is piling up requests.
When lag passes a threshold, loopbusy passes 503 errors to your middleware stack so your app can stay alive for some users instead of falling over for all users.
Options
;
Max Lag
;
The maximum lag (in ms) of your event loop.
Defaults to 250.
Interval
;
The polling interval (in ms) for measuring your event loop. Shorter values catch business faster at the cost of additional overhead.
Defaults to 1000.
Tests
npm test