# Why nginx took so many memory? Is it right?

**URL:** <https://www.ruby-forum.com/t/why-nginx-took-so-many-memory-is-it-right/182962>\
**Category:** NGINX\
**Created:** [February 5, 2010, 9:35am UTC](https://www.ruby-forum.com/t/why-nginx-took-so-many-memory-is-it-right/182962 "2010-02-05T09:35:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![21andy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/2/aca169/32.png) [@21andy](https://www.ruby-forum.com/u/21andy)\
**Post date:** [February 5, 2010, 9:35am UTC](https://www.ruby-forum.com/t/why-nginx-took-so-many-memory-is-it-right/182962/1 "2010-02-05T09:35:12Z")

</div>

My server: 8 core CPU , 2G memory , CentOS 5.3 64bit

nginx take 40M memory per thread, is it right?

I see other guys only 11M memory per-thread

and the php-cgi also take 40M memory per thread

I see other guys only 8M memory per-thread

could you tell me how to fix it?

thank you very much.

please see the pic  
[http://www.21andy.com/temp/nginx\_memory.gif](http://www.21andy.com/temp/nginx_memory.gif)

Posted at Nginx Forum:

> **[Why nginx took so many memory? Is it right?](https://forum.nginx.org/read.php?2,50831,50831#msg-50831)**
>
> My server: 8 core CPU , 2G memory , CentOS 5.3 64bit nginx take 40M memory per thread, is it right? I see other guys only 11M memory per-thread and the php-cgi also take 40M memory per thread I see other guys only 8M memory per-thread

---

<div class="post-metadata">

**Author:** ![21andy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/2/aca169/32.png) [@21andy](https://www.ruby-forum.com/u/21andy)\
**Post date:** [February 5, 2010, 9:49am UTC](https://www.ruby-forum.com/t/why-nginx-took-so-many-memory-is-it-right/182962/2 "2010-02-05T09:49:50Z")

</div>

mine was 73 MB virt, 3 MB res (x1 child), my cgi process: 747 MB virt,  
99 MB res (x2 child)

On Fri, Feb 5, 2010 at 3:34 PM, 21andy [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> could you tell me how to fix it?  
> nginx mailing list  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> [mailman.nginx.org archive](http://nginx.org/mailman/listinfo/nginx)

–  
Regards,  
Kiswono P  
GB

---

<div class="post-metadata">

**Author:** ![21andy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/2/aca169/32.png) [@21andy](https://www.ruby-forum.com/u/21andy)\
**Post date:** [February 5, 2010, 10:18am UTC](https://www.ruby-forum.com/t/why-nginx-took-so-many-memory-is-it-right/182962/3 "2010-02-05T10:18:00Z")

</div>

Here is mine

[http://www.flickr.com/photos/pcdinh/4331535395/sizes/o/](http://www.flickr.com/photos/pcdinh/4331535395/sizes/o/)

1 box: 8-core, 4GB RAM, RAID 1  
CentOS 5.4 32 bit  
PHP 5.3  
About 15 millions PHP requests per day

What I have done

- Custom build - Static linked
- Remove unneeded PHP extensions

21andy wrote:

> My server: 8 core CPU , 2G memory , CentOS 5.3 64bit
> 
> nginx take 40M memory per thread, is it right?
> 
> I see other guys only 11M memory per-thread
> 
> and the php-cgi also take 40M memory per thread
> 
> I see other guys only 8M memory per-thread
> 
> could you tell me how to fix it?
> 
> thank you very much.
> 
> please see the pic  
> [http://www.21andy.com/temp/nginx\_memory.gif](http://www.21andy.com/temp/nginx_memory.gif)
> 
> Posted at Nginx Forum:  
> [http://forum.nginx.org/read.php?2,50831,50831#msg-50831](http://forum.nginx.org/read.php?2,50831,50831#msg-50831)
