What's new

Squid in Entware failing on memory allocation

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Ronv42

Senior Member
This weekend strange things started to happen with Squid running on my AC87R. I have a lot of memory accoridng to free

total used free shared buffers
Mem: 255752 113432 142320 0 1144
-/+ buffers: 112288 143464
Swap: 0 0 0


But I am seeing the squid process dieing on the inabilty to allocate memory:

FATAL: xcalloc: Unable to allocate 1 blocks of 4128 bytes!

Squid Cache (Version 3.4.11): Terminated abnormally.
CPU Usage: 8.050 seconds = 3.870 user + 4.180 sys
Maximum Resident Size: 133040 KB
Page faults with physical i/o: 6
Memory usage for squid via mallinfo():
total space in arena: 27340 KB
Ordinary blocks: 27338 KB 7 blks
Small blocks: 0 KB 0 blks
Holding blocks: 840 KB 3 blks
Free Small blocks: 0 KB
Free Ordinary blocks: 1 KB
Total in use: 28178 KB 103%
Total free: 1 KB 0%

I never had this with Squid 2 but that version is no longer in the main entware distribution for ARM and had to convert to Squid 3. Anyone else having this issue? Any recomendations? In the squid site there is a section on this page that refernces ether a system imposed limitation or swap. I am not using swap so it may be a system limitiation:

http://wiki.squid-cache.org/SquidFaq/SquidMemory

I looked at ulimit on my router and this is no hard limit on memory:

ulimit -aH
-f: file size (blocks) unlimited
-t: cpu time (seconds) unlimited
-d: data seg size (kb) unlimited
-s: stack size (kb) 8192
-c: core file size (blocks) 0
-m: resident set size (kb) unlimited
-l: locked memory (kb) 64
-p: processes 1996
-n: file descriptors 1024
-v: address space (kb) unlimited
-w: locks unlimited
-e: scheduling priority 0
-r: real-time priority 0
 
Last edited:
After a week of testing researching and pulling out my hair on this issue I think I may have stumbled upon the issue. In squid 2 the cache_mem default value was 8 mb. In Squid 3 the default is 256 mb.

http://www.squid-cache.org/Doc/config/cache_mem/

Friday night I set the value 32 since the AC87R has more memory that my N66U and it has been running 24 hours without a crash. I would like to have it soak in for a few more days before I say that this is now solved. Keeping my fingers crossed.
 

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top