# Upstream with vps

**URL:** <https://www.ruby-forum.com/t/upstream-with-vps/229634>\
**Category:** NGINX\
**Created:** [February 11, 2013, 2:06am UTC](https://www.ruby-forum.com/t/upstream-with-vps/229634 "2013-02-11T02:06:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mdwalter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/87869e/32.png) [@mdwalter](https://www.ruby-forum.com/u/mdwalter)\
**Post date:** [February 11, 2013, 2:06am UTC](https://www.ruby-forum.com/t/upstream-with-vps/229634/1 "2013-02-11T02:06:58Z")

</div>

Hello guy, I’m sorry for my english  
So I have 4 vps:

1. 4gb ram 1 processor 1 ipv4
2. 2gb ram 4 processors 3 ipv4 + 3 ipv6
3. 1gb ram 4 processors 3 ipv4 + 3 ipv6
4. 1gb ram 4 processors 3 ipv4 + 3 ipv6

I thought this configuration:  
vps 1 with nginx and fastcgi php 5.4  
vps 2 with nginx for upstream and with mysql 5.5 with replicator  
vps 3 with nginx and fastcgi php 5.4  
vps 4 with nginx and mysql 5.5 and replicator

the first thing I wanted to tell you if the vps can hold 500/1000  
visitors a  
day with a dozen domains

vps 2 use it for upstream because it has 3 ipv4 available.  
We see the configuration of ngnix.conf:

user www-data;  
worker\_processes 4;  
pid /var/run/nginx.pid;

events {  
worker\_connections 1024;

# multi\_accept on;

}  
http {  
sendfile on;  
tcp\_nopush on;  
tcp\_nodelay on;  
keepalive\_timeout 65;  
types\_hash\_max\_size 2048;  
include /etc/nginx/mime.types;  
default\_type application/octet-stream;  
access\_log /var/log/nginx/access.log;  
error\_log /var/log/nginx/error.log;  
gzip on;  
gzip\_disable “msie6”;  
text/xml application/xml application/xml+rss text/javascript;  
include /etc/nginx/conf.d/_.conf;  
include /etc/nginx/sites-enabled/_;  
upstream backend {  
server 79.xxx.190:80; ← This is vps1  
server 199.xxx.72.100:80; ← this is vps2 (same vps of this file)

}  
}

Now setup for one domain:

server {  
listen 199.xxx.72.100;  
root /usr/share/nginx/computereconomy.com;  
index index.html index.htm;  
server\_name [computereconomy.com](http://computereconomy.com);  
location / {  
try\_files $uri $uri/ /index.html;  
}  
location /doc/ {  
alias /usr/share/doc/;  
autoindex on;  
allow 127.0.0.1;  
allow ::1;  
deny all;  
}  
location ~ .php$ {  
fastcgi\_split\_path\_info ^(.+.php)(/.+)$;  
fastcgi\_pass unix:/var/run/php5-fpm.sock;  
fastcgi\_index index.php;  
include fastcgi\_params;  
}  
gzip on;  
ssi on;  
ssi\_silent\_errors off;  
}

you think you can use a VPS to the upstream and viewing the site?  
or is there something I should do more or less?  
the vps1 is a normal setup (nginx) or should I configure it differently?  
if  
so, how?

Thanx!!

Posted at Nginx Forum:

> **[upstream with vps](https://forum.nginx.org/read.php?2,236068,236068#msg-236068)**
>
> Hello guy, I'm sorry for my english So I have 4 vps: 1. 4gb ram 1 processor 1 ipv4 2. 2gb ram 4 processors 3 ipv4 + 3 ipv6 3. 1gb ram 4 processors 3 ipv4 + 3 ipv6 4. 1gb ram 4 processors 3 ipv4 + 3 ipv6 I thought this configuration: v

---

<div class="post-metadata">

**Author:** ![mdwalter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/87869e/32.png) [@mdwalter](https://www.ruby-forum.com/u/mdwalter)\
**Post date:** [February 11, 2013, 9:49am UTC](https://www.ruby-forum.com/t/upstream-with-vps/229634/2 "2013-02-11T09:49:35Z")

</div>

you should be able to handle 1000 visitiors/day with a modern smartphone  
🙂

if your vps are running on the same host i’d suggest to strip down your  
setup  
to 2 machines and apply more ram/cpus for each machine, maybe in a  
hot-standby-scenario with a switchable failover-ip.

regards,

mex

Posted at Nginx Forum:

> **[Re: upstream with vps](https://forum.nginx.org/read.php?2,236068,236072#msg-236072)**
>
> Hello guy, I'm sorry for my english So I have 4 vps: 1. 4gb ram 1 processor 1 ipv4 2. 2gb ram 4 processors 3 ipv4 + 3 ipv6 3. 1gb ram 4 processors 3 ipv4 + 3 ipv6 4. 1gb ram 4 processors 3 ipv4 + 3 ipv6 I thought this configuration: v

---

<div class="post-metadata">

**Author:** ![mdwalter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/87869e/32.png) [@mdwalter](https://www.ruby-forum.com/u/mdwalter)\
**Post date:** [February 11, 2013, 1:22pm UTC](https://www.ruby-forum.com/t/upstream-with-vps/229634/3 "2013-02-11T13:22:51Z")

</div>

thanx for answer me.  
The all vps is in different datacenter europa and usa.  
Yes I know 1000 visitors in 24h for this server is not problem: 0.69  
visitors every second, but in reality the visitators can be 500 in same  
moment, maybe this is reason I make the load balancing and sure never  
know… some time some datacenter can came down.  
I wanna know if the back server can work like front server too.  
Thank again for answer 🙂

Posted at Nginx Forum:

> **[Re: upstream with vps](https://forum.nginx.org/read.php?2,236068,236078#msg-236078)**
>
> Hello guy, I'm sorry for my english So I have 4 vps: 1. 4gb ram 1 processor 1 ipv4 2. 2gb ram 4 processors 3 ipv4 + 3 ipv6 3. 1gb ram 4 processors 3 ipv4 + 3 ipv6 4. 1gb ram 4 processors 3 ipv4 + 3 ipv6 I thought this configuration: v

---

<div class="post-metadata">

**Author:** ![mdwalter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/87869e/32.png) [@mdwalter](https://www.ruby-forum.com/u/mdwalter)\
**Post date:** [February 11, 2013, 2:02pm UTC](https://www.ruby-forum.com/t/upstream-with-vps/229634/4 "2013-02-11T14:02:01Z")

</div>

depending on your webapp and ability to cache (static) files and content  
(e.g. the content changes every 10 minutes → you can deploy  
a 5 min cache) every server should be able to handle that  
ammount of request.

Posted at Nginx Forum:

> **[Re: upstream with vps](https://forum.nginx.org/read.php?2,236068,236083#msg-236083)**
>
> Hello guy, I'm sorry for my english So I have 4 vps: 1. 4gb ram 1 processor 1 ipv4 2. 2gb ram 4 processors 3 ipv4 + 3 ipv6 3. 1gb ram 4 processors 3 ipv4 + 3 ipv6 4. 1gb ram 4 processors 3 ipv4 + 3 ipv6 I thought this configuration: v
