1. Home
  2. vDDoS Proxy Protection
  3. Load Balancing

Load Balancing

Load Balancing is used when you have multiple Back-end servers and fewer vDDoS Server on the Front-end:

vDDoS Proxy Protection Load Balancing

Declare the Back-end name:

Assuming you have:

  • 1 vDDoS server at IP address: 16.11.16.20
  • 3 Web servers at IP addresses: 204.79.197.200, 107.154.75.41, 104.20.44.114
  • They all run under a Domain name: your-domain.com (both http and https).
  • So we will declare the back-end server as follows: (in the load-balancing.conf file)

    nano /vddos/conf.d/load-balancing.conf
    
    # Example create a backend name "backend1-nonssl" for "website.conf" from 3 server:
    
    	upstream backend1-nonssl {
    		least_conn;
    		ip_hash;
    		server 204.79.197.200:80 max_fails=3 fail_timeout=5s;
    		server 107.154.75.41:80 max_fails=3 fail_timeout=5s;
    		server 104.20.44.114:80 max_fails=3 fail_timeout=5s;
    	}
    
    # Example create a backend name "backend1-ssl" for "website.conf" from 3 server:
    	upstream backend1-ssl {
    		least_conn;
    		hash $remote_addr$http_user_agent;
    		server 204.79.197.200:443 max_fails=3 fail_timeout=5s;
    		server 107.154.75.41:443 max_fails=3 fail_timeout=5s;
    		server 104.20.44.114:443 max_fails=3 fail_timeout=5s;
    	}
    

  • backend1-nonssl for the back-end group running the HTTP protocol
  • backend1-ssl for the back-end group running the HTTPS protocol

  • Use the Back-end name:

    Replace that backend-name for the backend in the website.conf file:

    nano /vddos/conf.d/website.conf
    
    # Website       Listen            Backend               Cache  Security  SSL-Prikey  SSL-CRTkey
    your-domain.com	http://0.0.0.0:80 http://backend1-nonssl no     no       no          no
    your-domain.com https://0.0.0.0:443  https://backend1-ssl  no    no    /vddos/ssl/your-domain.com.pri /vddos/ssl/your-domain.com.crt
    

    Restart vDDoS:

    vddos restart
    


    Check Load Balancing:

    You can use the query tool from different IP addresses, different locations … to inspect the load balancing operation.

  • https://www.dotcom-tools.com/website-speed-test.aspx
  • https://www.site24x7.com/find-website-location.html
  • Was this article helpful to you? Yes No