Memory pools
-
Hello fellow Netgate community members,
Happy Thanksgiving!!!
Has anyone else enabled memory pools and pipeline prefect support?
This has increased my proxy speed substantiality. I thought I would share it is a drastic improvement.
Directives:
pipeline_prefetch 200
memory_pools onWhen they are both used together it’s more polished for websites
-
More research into this... I am happy someone else inquired about this to the Squid email system, here is the response.
On 2024-12-02 03:56, Masanari Iida wrote:
Hi,
I would like to understand memory_pools and memory_pools_limits setting.
In case memory_pools_limit is set to none (as default),
all squid process memory that can be seen by ps(1) is being used by squid?Yes, for some definition of "being used". Some of the memory reported by ps is idle memory_pools memory that is not used by current Squid transactions (but it is still "used" by Squid in general sense).
In case memory_pools_limit is set to 100MB and 1GB of memory is being
used by squid, then actual memory usage is 900MB and 100MB is reserved
as unused.If you are asserting that "100MB is reserved as unused", then I disagree with that assertion. Squid does not pre-allocate memory just because you enable memory pools. Special tricks (that I do not recommend using, and you are not discussing above) aside, Squid memory pools may only preserve previously used memory (to avoid re-allocation). memory_pools_limit limits how much previously used memory Squid can keep for that purpose.
In this case, process memory usage seen by ps(1) is 1GB.
Background of the question.
I would like to know whether memory_pool_limit size is
included in the process memory usage, seen from os commands such as
ps(1), top(1).The short answer is "yes": OS commands do not know anything about Squid internals and, hence, include everything Squid is using, but there are different kinds of "use".
N.B. Some Squid memory allocations do not go through memory pools.
HTH,
Alex.