Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Sun Oct 03, 2010 4:33 am 
Offline
Senior Newbie

Joined: Sun Oct 03, 2010 3:54 am
Posts: 5
Hi guys.

I setup Linux-Apache-MySQL-Rails for my rails app.

Then, I want to use nginx to serve static assets, because I don't want to load Apache too much. I heard this setup could be useful.

However, for performance sake, should I install nginx on the same server as Apache, or just create another disk image to make another Linux-nginx platform?

In result, I will have:

1. Ubuntu-Apache-MySQL-Rails to run my app on abc.com
2. Ubuntu-nginx to run my static assets on xyz.com

Will this be a better arrangement?


Top
   
 Post subject:
PostPosted: Sun Oct 03, 2010 4:46 am 
Offline
Senior Member

Joined: Tue Feb 19, 2008 10:55 am
Posts: 164
when you say disk image, it sounds like you want to run two at the same time on the same linode, you can't do that.

anyway, no need for a separate linode, nginx only uses a few megs of memory.

you'll either want to use a separate domain and ip for static content, or move apache to port 81 and nginx on 80 and set up a proxy config. it's well documented.


Top
   
 Post subject:
PostPosted: Sun Oct 03, 2010 4:51 am 
Offline
Senior Newbie

Joined: Sun Oct 03, 2010 3:54 am
Posts: 5
Sorry, not disk image, just different linodes.

So there shouldn't be any performance difference having nginx run seperately on another linode, or run on top of Apache?


Top
   
 Post subject:
PostPosted: Mon Oct 04, 2010 10:07 am 
Offline
Senior Member
User avatar

Joined: Tue May 26, 2009 3:29 pm
Posts: 1691
Location: Montreal, QC
Why mix and match? Why not use nginx for dynamic content too?


Top
   
 Post subject:
PostPosted: Mon Oct 04, 2010 10:18 am 
Offline
Senior Newbie

Joined: Sun Oct 03, 2010 3:54 am
Posts: 5
Apache performs better for dynamic content.


Top
   
 Post subject:
PostPosted: Mon Oct 04, 2010 10:26 am 
Offline
Senior Member
User avatar

Joined: Tue May 26, 2009 3:29 pm
Posts: 1691
Location: Montreal, QC
khuenping wrote:
Apache performs better for dynamic content.


Benchmarks seem to show this (while lighttpd is the opposite, faster doing PHP than Apache), but CPU load on a Linode is rarely the bottleneck. Is it worth running two different web servers when you could just run everything under a single web server, at a possible small performance hit?


Top
   
 Post subject:
PostPosted: Mon Oct 04, 2010 11:37 am 
Offline
Senior Member

Joined: Mon Oct 27, 2008 10:24 am
Posts: 173
Website: http://www.worshiproot.com
For a while I ran nginx as a static file server and reverse proxy to Apache (mod_wsgi and mod_php). I have since removed Apache from the equation and just run nginx with php-fpm and uwsgi on most boxes.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group