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 ability to set read_buffer_size for websockets #3165

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Zarathustra2
Copy link

Motivation

snapview/tungstenite-rs#468 changed the read buffer from 64KB to 128KB. It also added a method read_buffer_size so the read buffer size can be set. Currently there is no way to my knowledge so that Axum users can change the read buffer size.

After upgrading to axum 0.8 I noticed increased memory usage for my Websocket server and I assume the high read buffer is contributing to this. Since my websocket only receives small messages I would like to set it to something smaller than 128KB.

Solution

Added WebsocketUpgrade::read_buffer_size so that the read buffer size can be set.

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.

1 participant