TCP tuning of the origin server

To increase it to 4MB, run the following command in a live system (with root privileges)

echo 4194304 > /proc/sys/net/core/rmem_max

Alternatively, add/update the following line in /etc/sysctl.conf and reboot:

net.core.rmem_max = 4194304

The Linux kernel has a limit of 128KB on the TCP receive buffer size. This is sufficient to utilize the network bandwidth for most scenarios. However, it is not sufficient when the round trip time is unusually high. For a large fragment, the packager can push data at most one TCP window size at a time. It must then wait for an ACK message before sending more data. Because end-to-end latency is high, pushing the whole fragment takes lot of time. You can optimize this by increasing the maximum limit on the TCP receive buffer size at the origin server.