Re: [squid-users] Squid Optimization

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Thu, 13 Jun 2013 00:54:23 +1200

On 12/06/2013 11:49 p.m., Marcus Kool wrote:
>
>
> On 06/11/2013 11:19 PM, Matthew Ceroni wrote:
>> Thanks.
>>
>> But is there a config setting (prior to the workers option) that
>> controlled how many concurrent connections squid could handle? Using
>> the Apache example again where you configure Childs,
>> MaxThreadsPerChild, etc. Is there anything like that in squid?
>
> Squid is very different in this aspect.
> The number of workers is static and should be less or equal
> to the number of CPU cores.

Indeed...

There are no threads, so there are no thread limits.

There are no childs, so there are no child limits.

One Squid instance can handle however many connections the system FD
limits are configured to, which IIRC top out greater than 32 milllion,
but are usually configured down to a number a mere 4-6 digits long. When
FD limits are set very large the networking stack usually runs out of
usable IP:port tuplets first.

Nowdays there is "workers" configuring how many instances of Squid are
run in SMP environment, but as Marcus said that is more related to what
the CPU cores can handle than concurrent connections. Note that *each*
worker has the above limitations separately.

Squid can, and sometimes does, completely and utterly max out a machines
CPU and networking. The performance tricks are all about maximising
concurrent request throughput within the bare metal and light speed
limitations. :-)

On the flip side, Squid code is full of overly complex and slow
algorithms. So that limits its speed quite a lot. We are in a constant
effort to improve that and make it go faster.

>
> The maximum number of open files sometimes limits Squid, so make
> sure that the OS limit is high enough and the Squid setting is high
> enough.
>
> Marcus
>
>> On Tue, Jun 11, 2013 at 6:36 PM, Marcus Kool
>> <marcus.kool_at_urlfilterdb.com> wrote:
>>>
>>>
>>> On 06/11/2013 06:43 PM, Matthew Ceroni wrote:
>>>>
>>>> We are running squid as our primary proxy here at my office.
>>>>
>>>> What I am noticing is that connectivity is fine but every now and then
>>>> the browser sits with "Sending request". If I hope on the proxy and
>>>> view the access log I don't see it logging my request. After a few
>>>> seconds, sometimes as many as 10 - 15, the request comes through.
>>>>
>>>> My thought process is that the request is getting queued. I did a
>>>> little research about maximum concurrent connections but all I came
>>>> across was how to limit a specific user to max concurrent connections.
>>>
>>>
>>> There is too little information to make a conclusion but
>>> one should note that the HTTP command is only logged _after_ it has
>>> finished.
>>> So if you upload something large or if the webserver needs 15 seconds
>>> to process the request before it replies with a "thank you"
>>> it is normal to see the HTTP command only after 10-15 seconds in the
>>> log
>>> file.
>>>
>>> In case you still have doubts, you need to raise debug levels
>>> to find out what Squid is doing with the HTTP request.
>>>
>>> Marcus
>>
>>
Received on Wed Jun 12 2013 - 12:54:42 MDT

This archive was generated by hypermail 2.2.0 : Wed Jun 12 2013 - 12:00:17 MDT