Skip to content

Optimal chunk size for streaming response content #6285

Answered by asvetlov
fgallaire asked this question in Q&A
Discussion options

You must be logged in to vote

I concur with @Dreamsorcerer

Read buffer sizes for TCP Linux socket are: 4KB min, 85KB default, 4MB max. Linux dynamically adjusts the size.

Values lesser than 4KB don't add much value from the performance point of view.
4-8 (or even 16) MB can keep the read socket buffer empty and ready for new data packets.

The exact best number depends on your system and requires testing.

Replies: 4 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by fgallaire
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@fgallaire
Comment options

@fgallaire
Comment options

@fgallaire
Comment options

@asvetlov
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants