Welcome! Log In Create A New Profile

Advanced

Re: Rails App, Nginx, Virtual Hosts and bandwidth shaping

Anton Yuzhaninov
March 22, 2009 04:00PM
<a42b2c16fb320a285d06245963adb12e@ruby-forum.com>

Daniele :) wrote:
> Hi,
> I'm testing a Rails app that serves multiple different sites with a
> virtual hosts configuration under nginx. I need to set a limit
> per host basis so a single site will be unable to eat all the bandwidth
> and
> server resources. Nginx can limit per ip but not per vhost, right?
>
> Any solution?
> Thank you in advance :)

nginx currently can limit bandwidth only on per-connection basis.

But we can limit rate for each connection, and than limit maximum number of connection to each
virtual host.

Somethings like:

http {
limit_rate 250000;
limit_zone conn_to_server $server_name 10m;

limit_conn conn_to_server 100;

server { ... }
server { ... }
server { ... }
}

With this settings each virtualhost can't use more than 250000*100 = 25 Mbit of bandwidth.

--
Anton Yuzhaninov
Subject Author Posted

Rails App, Nginx, Virtual Hosts and bandwidth shaping

Daniele :) March 22, 2009 02:56PM

Re: Rails App, Nginx, Virtual Hosts and bandwidth shaping

Anton Yuzhaninov March 22, 2009 04:00PM

Re: Rails App, Nginx, Virtual Hosts and bandwidth shaping

Daniele :) March 22, 2009 05:16PM

Re: Rails App, Nginx, Virtual Hosts and bandwidth shaping

xin November 12, 2011 02:47PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 314
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready