# Proxy Cache: how much shared memory is "enough"?

**URL:** <https://www.ruby-forum.com/t/proxy-cache-how-much-shared-memory-is-enough/226502>\
**Category:** NGINX\
**Created:** [December 10, 2012, 10:37pm UTC](https://www.ruby-forum.com/t/proxy-cache-how-much-shared-memory-is-enough/226502 "2012-12-10T22:37:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SSChristian\_BSSnnin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/6f9a4e/32.png) [@SSChristian\_BSSnnin](https://www.ruby-forum.com/u/SSChristian_BSSnnin)\
**Post date:** [December 10, 2012, 10:37pm UTC](https://www.ruby-forum.com/t/proxy-cache-how-much-shared-memory-is-enough/226502/1 "2012-12-10T22:37:56Z")

</div>

Hi,

I’m planning to deploy some big websites which will make heavy usage of  
proxy cacheing (e.g. 1.5 million actively accessed objects in cache).  
The  
ratio of plain HTML vs images should be about 50/50 if that does have  
any  
impact on the scenario itself. Now the question which came up is how  
much  
Shared Memory for such a cache is enough. The docs don’t really say very  
much about that. So may be one of you can give me a hint on how much  
memory  
is suitable for such a deployment.

Thanks in advance.

Regards,  
Christian

---

<div class="post-metadata">

**Author:** ![SSChristian\_BSSnnin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/6f9a4e/32.png) [@SSChristian\_BSSnnin](https://www.ruby-forum.com/u/SSChristian_BSSnnin)\
**Post date:** [December 11, 2012, 9:06am UTC](https://www.ruby-forum.com/t/proxy-cache-how-much-shared-memory-is-enough/226502/2 "2012-12-11T09:06:33Z")

</div>

Hello!

On Mon, Dec 10, 2012 at 10:37:30PM +0100, Christian Bönning wrote:

> I’m planning to deploy some big websites which will make heavy usage of  
> proxy cacheing (e.g. 1.5 million actively accessed objects in cache). The  
> ratio of plain HTML vs images should be about 50/50 if that does have any  
> impact on the scenario itself. Now the question which came up is how much  
> Shared Memory for such a cache is enough. The docs don’t really say very  
> much about that. So may be one of you can give me a hint on how much memory  
> is suitable for such a deployment.

Each object in cache uses 128 bytes of memory in keys shared  
memory zone on 64-bit platforms, as outlined on wiki here:

> **[GitHub - nginxinc/nginx-wiki: ARCHIVED -- Source for the now archived NGINX Wiki...](https://github.com/nginxinc/nginx-wiki)**
>
> ARCHIVED -- Source for the now archived NGINX Wiki section of https://www.nginx.com

So for 1.5 mln objects you’ll need about 200M of memory.

–  
Maxim D.

> **[F5 NGINX: Built for cloud-native apps. Ready for AI traffic.](https://www.f5.com/products/nginx)**
>
> Deliver modern applications with NGINX. Explore high-performance load balancing, API gateways, and web server solutions trusted by top global enterprises.

---

<div class="post-metadata">

**Author:** ![SSChristian\_BSSnnin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/6f9a4e/32.png) [@SSChristian\_BSSnnin](https://www.ruby-forum.com/u/SSChristian_BSSnnin)\
**Post date:** [December 11, 2012, 9:19am UTC](https://www.ruby-forum.com/t/proxy-cache-how-much-shared-memory-is-enough/226502/3 "2012-12-11T09:19:24Z")

</div>

Seems that I should have read the docs better 😉

Thank you, Maxim.

Regards,  
Christian

2012/12/11 Maxim D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
