Distribution of traffic
morde last edited by
I've already asked a question like this here, but I still need details.
There's a website with a lot of activity, now it's on one server, and sometimes it's not gonna last, it's going to be in the 18-21 MSC lags. We need to make our own server with traffic distribution, for future improvement.
The pattern of traffic distribution shall be:
1. The first productivity gradient server is responsible for the complete version of the site.
2. The second server is also responsible for the mobile version of the site.
3. Third server with a gradient for rapid exchange of files, FTP, data storage (Manage).
User action plan: The client enters the site, redirects it to one of the first two servers, based on the device, the phone. Next up to the server, there's a request for files from the third server (TV).
There's iron on my hands, Domen.com.ru, network of 500 mbs.s, how am I supposed to do this?
It would be grateful for a detailed response with references and examples. Thank you.
Your package is understandable, but it doesn't work well. You've got a problem of productivity, the basic meaning of "no lagoons" that was created in the extra servak A, the earring under B, the earring under C. But it's all left to be wanted (business objectives, if you want), but not to offer to implement and resolve the problem.
Technically, you have two approaches to solving the problem of productivity. The first, cheap, is the roll-out of the project by iron (basekeeping), second, expensive, is a direct solution to the problem. As the developer ' s competence grows, he learns to deal with the problem in a second way, but in one way or another there are limits that the annex produces no physically (or makes no sense of the resources that need to be spent) and that the project is cheaper to be filled with additional iron. Judging by the description of the problem, I'm sure it's actually easier and better to solve, not through the scale, but through the direct codes, especially since you've already gathered to separate files, the application and the mobile application, and you just have to work in a few places.
There are three types of expansion. Typically, vertical scales (increase in the capacity of the Annex servers) and horizontal scales (increase in the number of servers and loads between them) are reported. The third path, which is not entirely of scale, roads and is not always possible, is to divide the annex into subscriptions and to separate servers (this is what you are going to do now). If you're on fire, it's easier to stave vertically and take time-outs to solve architectural problems. With regard to the proposed scheme, that's why it won't take off:
- You're going to make an application for "right now." This threatens well-known technical debt, high costs and zero exhaust, with the exception of sad experience.
- I'm not very clear about the quick release of files. Physically, how? Buy ssd? If so, why a separate server?
- Let's say, after moving to the cellular earring, 5 per cent of the load went, which the main earring did not notice. Puff, so much work and nothing.
- And finally, why do you even share a mobile and ordinary version if they give the same content and therefore have the same challenges and brakes?
Anyway, to fight the brakes, you need to find out, what exactly? It stops. Without that, you can, and you're going to waste a lot of resources. You need to start with the audit, identify the real cause of the loss of productivity, not the problem itself, and then think about how to solve it. You're about to do the following things:
- "Start" the statistic on a separate server. Let's say that the problem with the statistic is that the brakes aren't going anywhere, and you're spending three times more. And adding a statistic server just doesn't work out - it's either necessary to split the statics evenly between servers or store a full copy of all the statics on each server. And in the first case, the app doesn't know which server he's taking a specific file, the second you're gonna be dull with your head in the problem of finding untouched files in a 500-bs area.
- "Start" app. Is it ready for him? Are you ready to have different user sessions on the mobile application? What if the script creates a file at the time of request A, the B request for this file will come to a completely different server?
In summarizing the above, I would recommend:
- Run an audit, paint an application scheme, identify critical areas (what is not scaled up? what's stopping under load?
- Resolve the peto problem from the code. Believe me, she's in there, modern processors are processing just unbelievable amounts of data per second if they're given the right code.
- Prepare an annex to horizontal scale so that next time you don't have a garden.
- Move all the work with the statistic to the cloud (Amazon S3, Swift and analogs). It will save your servers from file requests (may take less disk and network) and from the above-mentioned problems with the scale of the statics (please do S3)
- Put a cheap server from Nginx / HAProxy as a slope to serve the application servers pool. In the case of the barracks, you can add another equivalent server to the pool so that it can be calibrated horizontally.
In general, these problems are solved by a pool of equivalent servers with the same copies of the application. But the annexes themselves, of course, are written with the idea of such use.