Adult Script Pro Community Forums

The forum is here for legacy reasons. No new posts will be created. User registration is disabled! If you have any questions, please email us or check https://www.adultscriptpro.com for more details!

You are not logged in.

#1 2017-03-15 17:49:47

happylag
Member
Registered: 2016-04-05
Posts: 182

Balance load equally

Hello,

I have my videos content on two servers node1.domain.com and node2.domain.com ( Two servers have exactly the same content ).

Would you know how to create a third subdomain media.domain.com to redirect traffic equally to node1.domain.com and node2.domain.com ?

Thank you.

Offline

#2 2017-03-16 06:56:59

symtab
Administrator
Registered: 2010-08-23
Posts: 7,501
Website

Re: Balance load equally


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

#3 2017-03-16 11:40:19

happylag
Member
Registered: 2016-04-05
Posts: 182

Re: Balance load equally

The problem with load balancing and only two servers is the load balancer gets all the bandwidth first.

"From the network point of view, your client establishes a TCP connection to you "loadbalancer". That session keeps running, until you create an other one somewhere else. But your loadbalancer would balance traffic, not redirect it."

Offline

#4 2017-03-16 19:20:45

symtab
Administrator
Registered: 2010-08-23
Posts: 7,501
Website

Re: Balance load equally

So basically you are balancing only for the video serving right? Not PHP?


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

#5 2017-03-16 20:57:05

happylag
Member
Registered: 2016-04-05
Posts: 182

Re: Balance load equally

No php only videos and photos.

Offline

#6 2017-03-17 08:37:54

symtab
Administrator
Registered: 2010-08-23
Posts: 7,501
Website

Re: Balance load equally

You can just use the main example from the above nginx documentation. Here is a more detailed documentation of nginx load balancing: https://www.nginx.com/resources/admin-g … -balancer/

Basically on one of your servers you will have something like:

http {
    upstream myapp1 {
        server srv1.example.com;
        server srv2.example.com;
    }

    server {
        listen ipyouwanttouseforallrequests:80;

        location / {
            proxy_pass http://myapp1;
        }
    }

    server {
       listen separateipforvideoserving:80;
       server_name srv1.example.com;

       here you have the root, the stuff for mp4 streaming
    }
}

on the other server you only have the second server block from the above example (the one for serving the videos).


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

#7 2017-03-17 11:16:52

happylag
Member
Registered: 2016-04-05
Posts: 182

Re: Balance load equally

The problem with this method is the bandwidth go through the load balancer first: ipyouwanttouseforallrequests:80

So if srv1.example.com use 500 mbps and srv2.example.com uses 500 mbps, the load balancer ipyouwanttouseforallrequests:80 will use 1 gbps.

Offline

#8 2017-03-19 07:42:56

symtab
Administrator
Registered: 2010-08-23
Posts: 7,501
Website

Re: Balance load equally

Hmmm...what you need in this case is DNS load balancing. Basically your requests to the 2 servers are distributed at DNS level. This way you will use bandwidth only from the server to which the request is done (not both the server and proxy). I have never configured a setup like this, but here are a few examples i found:
https://blog.l0cal.com/2015/04/30/using … -balancer/
https://en.wikipedia.org/wiki/Round-robin_DNS


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

Board footer

Powered by FluxBB