A
A
Andrey2022-03-24 14:43:10
linux
Andrey, 2022-03-24 14:43:10

Channel load balancing with NGIX across two VPSs?

I have a simple VPS that only has NGINX installed. VPS is used to upload/download heavy static files (zip, etc.) via a direct link. With a large number of downloads, the channel becomes clogged and the download speed of clients drops significantly. Another VPS was purchased to unload the network. I'm trying to unload the network using balancing via NGINX (upstream proxy_pass), so that all visitor requests are distributed one by one. Those. clicking the download link (example.com/test.zip) will download the test.zip file from UPU 1, and clicking the link example.com/test.zip again will start downloading the test.zip file from UPU 2 .

But I don't fully understand whether I'm digging in the right direction or not. If you parallel two VPS through NGINX (upstream proxy_pass), then when downloading a file from VPS 2, the traffic will only go through VPS 2, or will the channel to VPS 1 still be clogged?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
vreitech, 2022-03-24
@fzfx

you did not provide any network diagrams or the configuration of both nginx servers, and therefore I will answer to the best of my understanding of what you nevertheless reported.
proxy_pass is responsible for proxying requests to a different socket (i.e. to a different server/IP/port/socket type). and proxying means that the nginx server will establish a connection to the socket specified in proxy_pass, and incoming requests to the nginx server will be routed by this server over this newly established connection, and the responses to requests that come back will be sent to the client.
thus, if clients previously accessed a single server, establishing a connection and sending requests, and received responses from the server over this connection, now clients, accessing a single server, establishing connections, sending requests over it and receiving responses, also initiate the establishment connections to the second server, which receives requests from the first server and sends responses to it. i.e., the load on the channel has increased.

S
Sanes, 2022-03-24
@Sanes

In your case, there is no point in duplicating. Just spread the files across two VDS.
Better yet, use file storage services.

A
Alexander Karabanov, 2022-03-24
@karabanov

Remove proxying and configure Round robin DNS

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question