Skip to content

Conversation

AvinashAbbigeri
Copy link

This PR updates the README to document the memory usage of per-connection read and write buffers.

  • Adds description of ClientOption.ReadBufferEachConn (default: 0.5 MiB)
  • Adds description of ClientOption.WriteBufferEachConn (default: 0.5 MiB)
  • Provides example code snippet showing how to configure these options

Closes #885

@AvinashAbbigeri
Copy link
Author

This PR adds documentation for ReadBufferEachConn and WriteBufferEachConn under the Memory Consumption Consideration section, as requested in #885.

@rueian
Copy link
Collaborator

rueian commented Sep 22, 2025

Cool! But could you keep other irrelevant parts unchanged?

@AvinashAbbigeri
Copy link
Author

Can you check once now?

Comment on lines +430 to +436
In addition, each connection also allocates read and write buffers to reduce system calls during high concurrency
or large pipelines. These buffers are controlled by:

- `ClientOption.ReadBufferEachConn` (default: 0.5 MiB)
- `ClientOption.WriteBufferEachConn` (default: 0.5 MiB)

You can adjust these values in memory-sensitive environments to lower memory usage, at the cost of potential throughput.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you keep only this part? Others, including the example, are not necessary.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you want to change these?

Image

Can you revert them?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mention ReadBufferEachConn and WriteBufferEachConn on README
2 participants