[squid-users] memory_pools_limit question

Alex Rousskov rousskov at measurement-factory.com
Mon Dec 2 14:33:32 UTC 2024


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.




More information about the squid-users mailing list