overload-protection | Load detection and shedding capabilities | HTTP library
kandi X-RAY | overload-protection Summary
kandi X-RAY | overload-protection Summary
overload-protection provides integration for your framework of choice. If a threshold is crossed for a given metric, overload-protection will send an HTTP 503 Service Unavailable response, with (by default) a Client-Retry header, instructing the client (e.g. a browser or load balancer) to retry after a given amount of seconds.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Protect the options .
overload-protection Key Features
overload-protection Examples and Code Snippets
Community Discussions
Trending Discussions on overload-protection
QUESTION
I saw in this question how to setup Hapi Server to monitor the delay in the event loop of Node.js.
But I would like to log every time the delay exceeds a threshold, instead of returning 503.
How could I do it?
According to the API reference, there is an 'load' property in the server instance that contains the information I want, but I don't know how to listen to the event (or if there is such event) triggered when the load is checked.
UPDATE:
Ok, I found out there is a 'log' event that is triggered "when the server rejects a request due to high load", according to this.
But I just want to log, I don't want to reject any requests, so this doesn't solve the problem.
What I have so far, which logs when requests are rejected, is this:
...ANSWER
Answered 2017-Jun-23 at 14:15I found a solution that works for now, using node-toobusy, but I would be happy to know if it's possible to use only Hapi for this.
In case it helps someone, what I did was disabling the monitoring in Hapi, and keeping only node-toobusy checking it:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install overload-protection
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page