# Ngx\_slab\_alloc() failed: no memory in cache keys zone

**URL:** <https://www.ruby-forum.com/t/ngx-slab-alloc-failed-no-memory-in-cache-keys-zone/191106>\
**Category:** NGINX\
**Created:** [July 5, 2010, 6:39pm UTC](https://www.ruby-forum.com/t/ngx-slab-alloc-failed-no-memory-in-cache-keys-zone/191106 "2010-07-05T18:39:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Davide\_DSAmico](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/eb9ed0/32.png) [@Davide\_DSAmico](https://www.ruby-forum.com/u/Davide_DSAmico)\
**Post date:** [July 5, 2010, 6:39pm UTC](https://www.ruby-forum.com/t/ngx-slab-alloc-failed-no-memory-in-cache-keys-zone/191106/1 "2010-07-05T18:39:36Z")

</div>

Hi,  
I’m setting up a nginx reverse proxy on fbsd 8.1rc2 with this server  
config:

proxy\_cache\_path /usr/local/cache/zoneA levels=1:2 keys\_zone=IMAGES:10m  
inactive=1h max\_size=1g;

After two days of running, I noticed in /var/log/nginx-error.log a lot  
of lines:

2010/07/05 11:46:36 [crit] 85688#0: ngx\_slab\_alloc() failed: no memory  
in cache keys zone “IMAGES”  
2010/07/05 11:46:36 [crit] 85686#0: ngx\_slab\_alloc() failed: no memory  
in cache keys zone “IMAGES”  
2010/07/05 11:46:36 [crit] 85690#0: ngx\_slab\_alloc() failed: no memory  
in cache keys zone “IMAGES”

Why?

Am I to increase keys\_zone size?

I’m reading: [Module ngx\_http\_proxy\_module](http://wiki.nginx.org/NginxHttpProxyModule#proxy_cache_path)  
but it wasn’t useful.

Thanks in advance,  
d.

---

<div class="post-metadata">

**Author:** ![Davide\_DSAmico](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/eb9ed0/32.png) [@Davide\_DSAmico](https://www.ruby-forum.com/u/Davide_DSAmico)\
**Post date:** [July 6, 2010, 11:51am UTC](https://www.ruby-forum.com/t/ngx-slab-alloc-failed-no-memory-in-cache-keys-zone/191106/2 "2010-07-06T11:51:05Z")

</div>

keys\_zone size is not enough. increase it and reload nginx

On Mon, Jul 5, 2010 at 8:38 PM, Davide D’Amico  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> 2010/07/05 11:46:36 [crit] 85688#0: ngx\_slab\_alloc() failed: no memory in

–  
WBR  
Igor Homyakov  
System A., Embria
