Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation for server.options.load.maxEventLoopUtilization #4387

Merged
merged 1 commit into from
Nov 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion API.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ If the `listener` uses TLS, set [`tls`](#server.options.tls) to `true`.

#### <a name="server.options.load" /> `server.options.load`

Default value: `{ sampleInterval: 0, maxHeapUsedBytes: 0, maxRssBytes: 0, maxEventLoopDelay: 0 }`.
Default value: `{ sampleInterval: 0, maxHeapUsedBytes: 0, maxRssBytes: 0, maxEventLoopDelay: 0, maxEventLoopUtilization: 0 }`.

Server excessive load handling limits where:

Expand All @@ -174,6 +174,8 @@ Server excessive load handling limits where:

- `maxEventLoopDelay` - maximum event loop delay duration in milliseconds over which incoming requests are rejected with an HTTP Server Timeout (503) response. Defaults to `0` (no limit).

- `maxEventLoopUtilization` - maximum event loop utilization value over which incoming requests are rejected with an HTTP Server Timeout (503) response. Defaults to `0` (no limit).

#### <a name="server.options.mime" /> `server.options.mime`

Default value: none.
Expand Down Expand Up @@ -705,6 +707,7 @@ An object containing the process load metrics (when [`load.sampleInterval`](#ser
is enabled):

- `eventLoopDelay` - event loop delay milliseconds.
- `eventLoopUtilization` - current event loop utilization value.
- `heapUsed` - V8 heap usage.
- `rss` - RSS memory usage.

Expand Down
1 change: 1 addition & 0 deletions test/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -2098,6 +2098,7 @@ describe('Core', () => {

await server.inject('/');
expect(server.load.eventLoopDelay).to.be.above(0);
expect(server.load.eventLoopUtilization).to.be.above(0);
expect(server.load.heapUsed).to.be.above(1024 * 1024);
expect(server.load.rss).to.be.above(1024 * 1024);
await server.stop();
Expand Down