[squid-dev] [PATCH] Increase request buffer size to 64kb

Nathan Hoad nathan at getoffmalawn.com
Wed Mar 30 00:06:16 UTC 2016


Hello,

This (very small) patch increases the request buffer size to 64kb, from 4kb.

In my testing, this increases throughput rather dramatically for
downloading large files:

Pre patch:
100 5120M  100 5120M    0     0   126M      0  0:00:40  0:00:40 --:--:--  109M

CPU Usage: 40.500 seconds = 26.537 user + 13.963 sys

Post patch:

100 5120M  100 5120M    0     0   340M      0  0:00:15  0:00:15 --:--:--  329M

CPU Usage: 18.203 seconds = 12.477 user + 5.727 sys

The relevant numbers being that pre-patch it took 40 seconds/126MB a
second, and post patch it took 15 seconds/340MB a second. The above
tests were done against squid 4.0.7, serving a 5gb file built with
fallocate. The server was nothing fancy - Python's builtin HTTP
server.

Full disclosure, these numbers are over the loopback device - the
client, proxy and server are all on my laptop. If I move the proxy off
of my laptop, the numbers aren't as high, but the speed differences
are comparable.

We've been running this in production since late 2011 across many,
many deployments, and haven't had any issues with it. Part of me
wonders if this should be made configurable via the configure script?
Happy to work on that instead if people see value in it.

It's possible the same treatment should be applied to some of the
other buffer sizes in src/defines.h, but we have not modified these at
all.

Thank you,

Nathan.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: recv-buffer.patch
Type: text/x-patch
Size: 420 bytes
Desc: not available
URL: <http://lists.squid-cache.org/pipermail/squid-dev/attachments/20160330/c59ab40b/attachment.bin>


More information about the squid-dev mailing list