I asked a similar question before, but I believe I was not clear with the details.
I'm basically having some problems with my server related to high latency between the server and the clients due to the geographical distance. And making a research, it turned out that I can solve this issue by increasing the TCP Window Size.
The problem is I don't really know how to do it, and following the instructions I found on the web didn't help at all.
So I'm hoping that someone can share some documentation / commands / instructions or anything that can further improve this question.
Here is some info:
- OS: Ubuntu 20.04 (LTS) x64
- Server: Apache/2.4.41
- Application Type: Python – Flask
- Hosting Company: Digital Ocean
Edit:
After several replies telling me that adjusting the Window Size won't solve the problem, I think I was not clear enough.
Please refer to this answer before telling me that changing the Window Size won't work.
https://networkengineering.stackexchange.com/a/2297/71565
If you believe that I misunderstood the answer in the link above, please tell me what in particular I'm getting wrong and don't just share a cryptic reply of "it won't work" etc.
Best Answer
I'm not 100% convinced your issue is really window-size related. Still, below you can find the relevant info.
The base window size can not exceed 65535 bytes due to limitations of the TCP header. From RFC 1323:
This does not means the TCP window can't be bigger, as modern OSes support (and advertise by default) TCP Window Scaling, where the window size is dynamically increased via scaling by up to 14X factor. However, an upper limit can be configured before hitting maximum scaling.
For reference, these are the relevant parameters (and their defaults) on Ubuntu 20.04:
The actual maximum window size is the smaller between
[r|w]mem_max
and the third value oftcp_[r|w]mem
. So on Ubuntu 20.04 you have an actual max receive and send window of 212992 bytes by default. To increase that limit to 4 MB you can do the following:If it works, you can persist the settings by editing
/etc/sysctl.conf