-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Labels
featureNew functionality or improvementNew functionality or improvement
Milestone
Description
Support plan
- is this issue currently blocking your project? (yes/no): no
- is this issue affecting a production system? (yes/no): no
Context
- node version: n/a
- module version: n/a
- environment (e.g. node, browser, native): n/a
- used with (e.g. hapi application, another framework, standalone, ...): n/a
- any other relevant information: n/a
What problem are you trying to solve?
Hapi currently supports limiting the server load by measuring the event loop delay and memory usage. Node recently introduced a new metric event loop utilization which is meant to more accurately measure the cpu utilization, a good candidate for this functionality:
ELU is similar to CPU utilization, except that it only measures event loop statistics and not CPU usage. It represents the percentage of time the event loop has spent outside the event loop's event provider (e.g. epoll_wait). No other CPU idle time is taken into consideration.
Do you have a new or modified API suggestion to solve the problem?
We could introduce a new option as part of the server load options:
server.options.loadmaxEventLoopUtilization- maximum event loop utilization value in milliseconds over which incoming request are rejected with an HTTP Server Timeout (503) response. Defaults to 0 (no limit).
'use strict';
const Hapi = require('@hapi/hapi');
const server = Hapi.server({
load: {
maxEventLoopUtilization: 0,
},
});Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
featureNew functionality or improvementNew functionality or improvement