Skip to content

Increase buffer pool size and streams high water marks #27121

Open
@BridgeAR

Description

@BridgeAR

Our Buffer pool size is currently set to 8kb. This seems pretty low for most hardware used these days.

Similar with our default high water marks in streams (16kb for all streams besides fs readable streams that are set to 64kb).

Increasing the buffer size allows less allocations to be used in general and increasing the default high water mark reduces the number of chunks which improves the throughout a lot.

I would like to increase the buffer pool size to 128kb. The regular high water mark could increase to 64kb and the high water mark for fs to e.g., 256kb.

Those numbers are all "magical" numbers but they seem better defaults than the current ones. Please let me know if there are reasons to either not change the defaults or if you have an alternative suggestion.

It is also possible to change the Buffer's pool size default during runtime and to set each high water mark per stream.

@nodejs/fs @nodejs/streams @nodejs/buffer PTAL

Metadata

Metadata

Assignees

No one assigned

    Labels

    bufferIssues and PRs related to the buffer subsystem.fsIssues and PRs related to the fs subsystem / file system.performanceIssues and PRs related to the performance of Node.js.streamIssues and PRs related to the stream subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions