# Nginx Vs Apache in Dynamic Page

**URL:** <https://www.ruby-forum.com/t/nginx-vs-apache-in-dynamic-page/197650>\
**Category:** NGINX\
**Created:** [October 18, 2010, 12:13pm UTC](https://www.ruby-forum.com/t/nginx-vs-apache-in-dynamic-page/197650 "2010-10-18T12:13:42Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/77aa72/32.png) [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Post date:** [October 18, 2010, 12:13pm UTC](https://www.ruby-forum.com/t/nginx-vs-apache-in-dynamic-page/197650/1 "2010-10-18T12:13:42Z")

</div>

The website is now running Nginx + PHP-fpm.

But I’ve heard, that Nginx (for static files) with Apache as a backend,  
will be  
faster. Because apache can nicely handle dynamic page.

Is that true?

---

<div class="post-metadata">

**Author:** ![Indo\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/ce7236/32.png) [@Indo\_P](https://www.ruby-forum.com/u/Indo_P)\
**Post date:** [October 18, 2010, 2:05pm UTC](https://www.ruby-forum.com/t/nginx-vs-apache-in-dynamic-page/197650/2 "2010-10-18T14:05:36Z")

</div>

Yes that’s what I’m asking… Which one is better for dynamic website

---

<div class="post-metadata">

**Author:** ![Indo\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/ce7236/32.png) [@Indo\_P](https://www.ruby-forum.com/u/Indo_P)\
**Post date:** [October 18, 2010, 1:38pm UTC](https://www.ruby-forum.com/t/nginx-vs-apache-in-dynamic-page/197650/3 "2010-10-18T13:38:13Z")

</div>

Apache can handle php-fpm too, but efficiency depends on php-fpm. I  
think, better way is use one server.

On Mon, Oct 18, 2010 at 1:12 PM, Indo P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> 

–  
Pagarbiai.

---

<div class="post-metadata">

**Author:** ![Indo\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/ce7236/32.png) [@Indo\_P](https://www.ruby-forum.com/u/Indo_P)\
**Post date:** [October 19, 2010, 4:27pm UTC](https://www.ruby-forum.com/t/nginx-vs-apache-in-dynamic-page/197650/4 "2010-10-19T16:27:35Z")

</div>

Did you mean better means easy and secure?

Regards,  
Joe

---

<div class="post-metadata">

**Author:** ![Indo\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/ce7236/32.png) [@Indo\_P](https://www.ruby-forum.com/u/Indo_P)\
**Post date:** [October 19, 2010, 6:24pm UTC](https://www.ruby-forum.com/t/nginx-vs-apache-in-dynamic-page/197650/5 "2010-10-19T18:24:59Z")

</div>

Easy isn’t a problem. Because nginx is easier actually 🙂

I just wondering which is giving a best performance when serving a  
dynamic page (trough php), php-fpm or apache

---

<div class="post-metadata">

**Author:** ![Indo\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/ce7236/32.png) [@Indo\_P](https://www.ruby-forum.com/u/Indo_P)\
**Post date:** [October 20, 2010, 2:04am UTC](https://www.ruby-forum.com/t/nginx-vs-apache-in-dynamic-page/197650/6 "2010-10-20T02:04:35Z")

</div>

You’ll find results vary per application, but generally Nginx + PHP-FPM  
performs better than Apache + Mod\_PHP.  
I’m not sure how this would compare to Apache + PHP-FPM or PHP-CGI.

---

<div class="post-metadata">

**Author:** ![Indo\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/ce7236/32.png) [@Indo\_P](https://www.ruby-forum.com/u/Indo_P)\
**Post date:** [October 21, 2010, 11:23am UTC](https://www.ruby-forum.com/t/nginx-vs-apache-in-dynamic-page/197650/7 "2010-10-21T11:23:05Z")

</div>

I guess Nginx will be much better than Apache.

If we compare NGINX+PHP-FPM _vs_ APACHE+PHP-FPM then PHP-FPM being  
common  
part, comparison need to be done between Nginx and Apache.  
Nginx itself is way better than Apache as it takes very less memory.

Our server CPU never crossed 1.0 load level since we moved to Nginx even  
with continuous rise in traffic. In Apache days, we had a cron job to  
reboot  
server every 24-hours!

–  
Rahul B. | Founder & CEO | rtCamp Solutions Pvt. Ltd.  
Skype: rahul286 | Twitter: @rahul286 | Web: [http://rtcamp.com/](http://rtcamp.com/)
