D
D
Diversia2022-03-29 09:40:15
linux
Diversia, 2022-03-29 09:40:15

What power should be the server for proxying?

Hello.
On the server, you need to change the IP address so that the site does not turn off during the DNS update. I think Nginx proxying is the best. Please tell me what characteristics should be the server for proxying. Now a site with high traffic, 0.5Tb/day traffic is spinning on VPS: CentOS 7, 8 CPU, 16 RAM, SSD.
Can the speed of the site slow down when using proxying? What other reefs can arise in this case?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Drno, 2022-03-29
@Drno

Naturally, the speed will decrease.
The server needs one that can drive 1tb traffic per day through itself (emphasis on the CPU and network)
. You change the DNS record to the ip of the proxy server at the beginning, it will be some kind of simple ...

H
hint000, 2022-03-29
@hint000

Drno ,

Naturally, the speed will decrease.
There is nothing natural in this. In a normal situation, the reverse proxy increases the speed, not slows it down.
You will change the DNS entry to the ip of the proxy server first, it will be some kind of simple ...
There will be no downtime if you don't make mistakes. Those who have already updated the record will go through the proxy. Who did not have time to update - they will go directly without a proxy. Just for such operations you need to lay the waiting time between individual changes. They made one change, waited a day so that everyone had time to update their records with a good margin, made the second change. And no downtime.

E
Eugene Wolf, 2022-03-29
@Wolfnsex

I'll try in order:
How powerful should the proxy server be?If I understand you correctly, the task is to raise / configure the reverse (reverse) proxy. Since this is a proxy, and not a "mirror" of hardware, I would start with a machine level: 2 cores, 2-4GB of RAM. The disk does not really matter, because. it's a proxy. In theory, such a machine for a proxy should be enough. The key emphasis should be on the port (network) speed of this very proxy server, because Not every VPS can freely download 500GB per day. With very good connection quality, the port is 100Mbps. (namely, most VPS provide such a nominal port speed) can pump about 1TB / day. You have a traffic of 0.5Tb per day. Taking into account the fact that the traffic on the site is never uniform (in some period of time the traffic is higher, in some it is lower, there are some peaks in traffic, etc.), and also taking into account the fact that that the speed is 100Mbps. on VPS - exclusively nominal - I think it's worth looking for a VPS with a port speed of 1Gbps.
Can the speed of the site slow down when using proxying? Not only can, but most likely it will decrease. Any proxy is the additional distance that traffic must travel from the server to the client (and vice versa). The further the proxy is located from the source server, the greater the speed drawdown will be. And again, if the proxy does not have enough bandwidth (port speed) - the speed drop for the client will also be multiplied by the lack of bandwidth.
Of course, there are also reverse cases when the source server is somewhere far away, and the proxy server is somewhere near the client and the client has some very bad route to the source server (bad connection), but with the proxy server the connection is good and between the proxy server and the source server is also a good connection ... in this case, the connection can even be accelerated, but in modern networks this is rather an exception to the rule, I would not count on it too much. Separately, you can highlight various caching proxies and CDNs that speed up downloads ... but this is your case.
What other reefs can arise in this case?
The key "stone" that I currently see is not clear why do you need it at all? Will the server's IP address just change? - you can add as many IP addresses as you want to the server, you can keep both the old and new IP on the server for 48-72 hours (DNS update cycle), then untie the old IP ... If at some point you have 2 copies of the site, old and new (with different corresponding IPs) - then you don’t need a proxy here either, just keep two of them at once, then turn off the old one. Or first we make a proxy to the current site, then we change the DNS record, we wait for the full DNS update, then we transfer the site to another server, then we change the DNS record again ... - but even in this case, there will still be some time downtime for site transfer and / or database synchronization (of course, there are ways to avoid this, but this is a separate big topic).
PS Perhaps, in your case, since we are talking about a 1-1 proxy, does it make sense to configure the proxy not through Nginx, but to completely wrap the traffic to another server? Through some tunnel, for example, WireGuard + iptables / nftables - this will allow you to proxy everything in general (all traffic), and not just HTTP / HTTPS and, accordingly, avoid incidents when proxying through Nginx, in particular, Nginx proxy can add some own headers, or vice versa, delete some (yes, this is all configurable, of course, but this needs to be configured and checked). Then HTTPS, I did not try to proxy the HTTPS server through Nginx, but I think there may be some difficulties with this, resp. you will need to raise HTTP on the source server (this is at the level of my assumptions, I have not tried to proxy HTTPS through Nginx).
Also, I suggest you consider alternative proxy options, for example HAProxy , hypothetically, using proxy-oriented software exclusively for solving problems will give a better effect than Nginx, in which the proxy is only a side function. You can also use this link to see what resources are required for the proxy server (section "Performance").

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question