# Memory usage of fresh nginx

**URL:** <https://www.ruby-forum.com/t/memory-usage-of-fresh-nginx/208370>\
**Category:** NGINX\
**Created:** [June 16, 2011, 2:19pm UTC](https://www.ruby-forum.com/t/memory-usage-of-fresh-nginx/208370 "2011-06-16T14:19:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [June 16, 2011, 2:19pm UTC](https://www.ruby-forum.com/t/memory-usage-of-fresh-nginx/208370/1 "2011-06-16T14:19:46Z")

</div>

I installed nginx (0.8.7) by rpm on Centos with php-fpm. The total  
memory used was about 45K

I installed nginx (1.0.4) from source on the same conditions, but the  
total memory used is about 90K

as I compared the memory usage by top, I can see the amount used by each  
php-fpm process is double in the latter case. Any idea? Do I need to  
adjust setting?

Posted at Nginx Forum:

> **[Memory usage of fresh nginx](https://forum.nginx.org/read.php?2,207506,207506#msg-207506)**
>
> I installed nginx (0.8.7) by rpm on Centos with php-fpm. The total memory used was about 45K I installed nginx (1.0.4) from source on the same conditions, but the total memory used is about 90K as I compared the memory usage by top, I can see the...

---

<div class="post-metadata">

**Author:** ![etrader](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/b5e925/32.png) [@etrader](https://www.ruby-forum.com/u/etrader)\
**Post date:** [June 16, 2011, 4:30pm UTC](https://www.ruby-forum.com/t/memory-usage-of-fresh-nginx/208370/2 "2011-06-16T16:30:35Z")

</div>

Hi.

The two are unrelated, Nginx has no effect on PHP as there is a fastcgi  
abstraction layer inbetween them. Recompiling Nginx does not recompile  
PHP.

Posted at Nginx Forum:

> **[Re: Memory usage of fresh nginx](https://forum.nginx.org/read.php?2,207506,207570#msg-207570)**
>
> I installed nginx (0.8.7) by rpm on Centos with php-fpm. The total memory used was about 45K I installed nginx (1.0.4) from source on the same conditions, but the total memory used is about 90K as I compared the memory usage by top, I can see the...

---

<div class="post-metadata">

**Author:** ![etrader](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/b5e925/32.png) [@etrader](https://www.ruby-forum.com/u/etrader)\
**Post date:** [June 16, 2011, 5:37pm UTC](https://www.ruby-forum.com/t/memory-usage-of-fresh-nginx/208370/3 "2011-06-16T17:37:07Z")

</div>

They are two separate servers with fresh installation. I mean what can  
be the cause of this double memory usage in the nginx setting. For some  
reason, php-fpm is consuming double memory; or maybe fastcgi interface  
is doing this. I’m just curious to know what setting can be the cause.

Posted at Nginx Forum:

> **[Re: Memory usage of fresh nginx](https://forum.nginx.org/read.php?2,207506,207597#msg-207597)**
>
> I installed nginx (0.8.7) by rpm on Centos with php-fpm. The total memory used was about 45K I installed nginx (1.0.4) from source on the same conditions, but the total memory used is about 90K as I compared the memory usage by top, I can see the...

---

<div class="post-metadata">

**Author:** ![etrader](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/b5e925/32.png) [@etrader](https://www.ruby-forum.com/u/etrader)\
**Post date:** [June 17, 2011, 2:48am UTC](https://www.ruby-forum.com/t/memory-usage-of-fresh-nginx/208370/4 "2011-06-17T02:48:15Z")

</div>

The difference in the Nginx memory size can be due to the modules you  
have compiled in or the amount and size of buffers you have allocated.

The difference in the PHP memory size can be anything from modules  
compiled in/dynamically linked to what type of scripts you’re running.

One thing I can tell you with certainty is that Nginx does not affect  
the memory usage of PHP.

Posted at Nginx Forum:

> **[Re: Memory usage of fresh nginx](https://forum.nginx.org/read.php?2,207506,207750#msg-207750)**
>
> I installed nginx (0.8.7) by rpm on Centos with php-fpm. The total memory used was about 45K I installed nginx (1.0.4) from source on the same conditions, but the total memory used is about 90K as I compared the memory usage by top, I can see the...

---

<div class="post-metadata">

**Author:** ![etrader](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/b5e925/32.png) [@etrader](https://www.ruby-forum.com/u/etrader)\
**Post date:** [June 17, 2011, 10:13am UTC](https://www.ruby-forum.com/t/memory-usage-of-fresh-nginx/208370/5 "2011-06-17T10:13:00Z")

</div>

On Thu, Jun 16, 2011 at 08:19:09AM -0400, etrader wrote:

> I installed nginx (0.8.7) by rpm on Centos with php-fpm. The total  
> memory used was about 45K
> 
> I installed nginx (1.0.4) from source on the same conditions, but the  
> total memory used is about 90K
> 
> as I compared the memory usage by top, I can see the amount used by each  
> php-fpm process is double in the latter case. Any idea? Do I need to  
> adjust setting?

Could you show top samples ?

–  
Igor S.
