[squid-users] shared_memory_locking failed to mlock

Alex Rousskov rousskov at measurement-factory.com
Mon Jul 16 16:58:20 UTC 2018


On 07/15/2018 08:47 PM, Gordon Hsiao wrote:
> Just upgraded squid to 4.1, however if I enabled shared_memory_locking I
> failed to start squid:
> 
> "FATAL: shared_memory_locking on but failed to
> mlock(/squid-tls_session_cache.shm, 2101212): (12) Out of memory"

> How do I know how much memory it is trying to mlock? is 2101212(~2MB)
> the shm size of not,

Yes, Squid tried to lock a 2101212-byte segment and failed.


> any way to debug/looking-into/config this size?

I am not sure what you mean, but please keep in mind that the failed
segment could be the last straw -- most of the shared memory could be
allocated earlier. You can observe all allocations/locks with 54,7
debugging. Look for "mlock(".

You can also run "strace" or a similar command line tool to track
allocations, but analyzing strace output may be more difficult than
looking through Squid logs.


> Again I disabled cache etc for a memory restricted environment, also
> used the minimal configuration with a few enable-flags, in the meantime
> I want to avoid memory overcommit from squid(thus mlock)

I am glad the new code is working to prevent runtime crashes in your
memory-restricted environment. If studying previous mlock() calls does
not help, please suggest what else Squid could do not help you.


Thank you,

Alex.


More information about the squid-users mailing list