[squid-users] Squid: Small packets and low performance between squid and icap

Prashanth Prabhu prashanth.prabhu at gmail.com
Thu Nov 5 19:56:41 UTC 2015


Hi Amos,

>> I failed to mention that I am on 3.5.1. And, readSomeData() is already "fixed":
>
> Bug 4353 exists because the initial fix for 4206 was not enough to fully
> remove the behaviour. Sometimes yes, sometimes no.
>
> Only the nasty hack of allocating buffers twice and throwing one away
> unused seems to work fully so far. That is the patch in 4353.


To be clear, the code in 3.5.1 is already using the
in.maybeMakeSpaceAvailable() call, therefore the patch for 4353 is
useless for me.

It appears that sometime during 3.5.3 the code was modified to use the
following check instead and that is being backed out with 4353.
----
     if (Config.maxRequestBufferSize - in.buf.length() < 2)
----

I thought that perhaps the first patch from 4206 would help, but a
quick test has shown that it doesn't.

Are there any documents on how buffer management is done in Squid? I
am seeing small buffers being used to read from the client-side
connection and I don't quite understand why. Why not read as much as
possible, within the bounds of the space available in the "bodypipe",
so we maximize the reads?


Regards.
Prashanth

On 5 November 2015 at 07:14, Amos Jeffries <squid3 at treenet.co.nz> wrote:
> On 5/11/2015 10:41 p.m., Prashanth Prabhu wrote:
>> Hello Amos,
>>
>> Thanks for the quick response.
>>
>> I failed to mention that I am on 3.5.1. And, readSomeData() is already "fixed":
>
> Bug 4353 exists because the initial fix for 4206 was not enough to fully
> remove the behaviour. Sometimes yes, sometimes no.
>
> Only the nasty hack of allocating buffers twice and throwing one away
> unused seems to work fully so far. That is the patch in 4353.
>
>
>> ----
>> void
>> ConnStateData::readSomeData()
>> {
>>     if (reading())
>>         return;
>>
>>     debugs(33, 4, HERE << clientConnection << ": reading request...");
>>
>>     if (!in.maybeMakeSpaceAvailable())
>>         return;
>>
>>     typedef CommCbMemFunT<ConnStateData, CommIoCbParams> Dialer;
>>     reader = JobCallback(33, 5, Dialer, this, ConnStateData::clientReadRequest);
>>     Comm::Read(clientConnection, reader);
>> }
>> ----
>>
>> I am planning to try the "patch client_side.cc to call
>> maybeMakeSpaceAvailable()" from #4206. Anything else, I should try?
>
> The patch from 4353.
>
> And also upgrading to 3.5.11 unless that was a typo in the version
> number *.1 above.
>
> Amos
>


More information about the squid-users mailing list