Welcome! Log In Create A New Profile

Advanced

question about load balancing setup

Posted by jpilon 
question about load balancing setup
March 15, 2010 02:23AM
Hello,

I haven't actually deployed nginx yet, very interested in in though.

Couple questions about performance. We're thinking about moving to rackspace cloud servers and setting up a load balanced config with the following:
- 1 2gb ram database only server
- 2 www apache/php web servers
- 1 nginx server

When an incoming request comes in it goes to the nginx server and routes it one of the www servers (via reverse proxy or whatever, we'd plan to add more servers later). In terms of performance, how good of performance would the nginx router be with a 256mb ram server? Right now our sites get around 250,000 page views. Would this handle ok without any issues?

Any tips for most stable linux os for the nginx? fedora core?

I'm not familiar with reverse proxy or how nginx works, but when an incoming request goes to the nginx server, gets routed to one of the www servers, does it get routed back to the nginx server and then to the visitor? or does it route straight from the www server to the visitor bypassing nginx?

Or if someone can post a link to a tutorial for a better setup than this I'd appreciate it. We like apache for it's simplicity and .htaccess (our htaccess file is fairly complex). We're basically looking for a simple way where we can easily scale up servers when traffic increases, I don't like apache as it's slow but if we have 2+ servers it instantly reduces the load to a better level.
Re: question about load balancing setup
March 15, 2010 12:48PM
jpilon Wrote:
-------------------------------------------------------
> Hello,
>
> I haven't actually deployed nginx yet, very
> interested in in though.
>
> Couple questions about performance. We're thinking
> about moving to rackspace cloud servers and
> setting up a load balanced config with the
> following:
> - 1 2gb ram database only server
> - 2 www apache/php web servers
> - 1 nginx server
>
> When an incoming request comes in it goes to the
> nginx server and routes it one of the www servers
> (via reverse proxy or whatever, we'd plan to add
> more servers later). In terms of performance, how
> good of performance would the nginx router be with
> a 256mb ram server? Right now our sites get around
> 250,000 page views. Would this handle ok without
> any issues?

Hard to say but very possibly if that server is being used for nothing else. How would you be serving static files? You should consider serving them via nginx.

>
> Any tips for most stable linux os for the nginx?
> fedora core?

I think it's a matter of personal preference. For some people it's almost a "religious" thing. ;) I am most used to CentOS/RHEL and Ubuntu myself, but prefer FreeBSD if you're willing/able to go outside Linux.

>
> I'm not familiar with reverse proxy or how nginx
> works, but when an incoming request goes to the
> nginx server, gets routed to one of the www
> servers, does it get routed back to the nginx
> server and then to the visitor? or does it route
> straight from the www server to the visitor
> bypassing nginx?

It has to go back to the front end nginx server as that is the one with the connection to the client. The client is expecting a response from the IP to which it was connected.

>
> Or if someone can post a link to a tutorial for a
> better setup than this I'd appreciate it. We like
> apache for it's simplicity and .htaccess (our
> htaccess file is fairly complex). We're basically
> looking for a simple way where we can easily scale
> up servers when traffic increases, I don't like
> apache as it's slow but if we have 2+ servers it
> instantly reduces the load to a better level.

Apache will run much more efficiently when it is a back end as it can drop connections quickly after communicating with the front end over a fast network connection, rather than having to slowly feed the response to the client.

If you are currently using three servers (two backend servers and one db server) you may be able to do all this with one back end sever and one db server, or one main server housing nginx and whatever back end you choose (Apache or a fastcgi process manager) and one for your db.

--
Jim Ohlstein
Re: question about load balancing setup
March 17, 2010 08:59PM
Hello Jim,

Thanks for the tips. I did setup a 3 server setup right now, one for db, one for nginx as front end, and one (right now) for apache. It's all working great on centos for all 3, very happy with progress today :)

Did have one issue which serving images locally via nginx but that's in another thread.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 140
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready