
Hi, Habr!
Today we want to talk about our fourth-generation virtual hosting (we call it so), which we have recently implemented and which has been in closed testing until now.
Just want to say that this system was developed by our colleagues from the company Parallels.
Our merit is that we are the first to introduce this solution in Russia.
In this regard, I will mention in my story three types of hosting: classic virtual hosting, our current slightly “doped” apache hosting and new hosting, codenamed 4G, which is what we are talking about. By the way, you have the opportunity to test it for three months and express your wishes and suggestions, or tell about the bugs found (about this at the end of the article). But first, let's take a closer look at what is so new and interesting about this new hosting.
So, what is virtual Apache hosting? This is one large server with a high enough population density, which makes it very cheap, affordable and popular. But in this regard, there are a number of problems that await the client, many of which we managed to solve by introducing fourth-generation hosting.
')
Architecture.
Let's start with the classic hosting architecture:

We have several web servers, a separate database server and a management system that is responsible for the configuration of web servers, everything is simple, everyone knows about it.
Our new hosting has a cluster architecture:
The main components include load balancers, Linux web servers (with Apache), Linux database servers (with MySQL or PostgreSQL), and an NFS server. The general scheme is shown in the figure below.

And all the fun inside:
Load balancers:- They are used to provide high resiliency, dynamic load redistribution and seamless resource management;
- Direct routing is used - any web server can respond to requests for any IP;
- For efficient caching, continuous sessions are used.
Web servers:- Each web server can handle requests for any site; there is no binding of the site to the web server;
- Web servers also handle FTP and SSH connections;
- Web servers are running Cloud Linux OS, which supports the LVE (Light Virtual Environment) technology, which allows you to strictly isolate individual sites from each other.
Storage Servers:- Clients using MySQL are served by multiple servers;
- NFS3 file systems are used to store site content;
- All file systems connect to all web servers.
Configuration database and control module:- The configurations of all sites managed by the web cluster system are stored in a central configuration database on a separate server;
- The cache service of the module for providing virtual hosting is used to obtain configuration data of the sites; this service caches data in RAM, and deletes it if it changes in the configuration database;
- The cache service automatically switches to the copy server if the main configuration database is not available.
The main differences and advantages of the new hosting.
1. Security.
In a classic hosting, client sites on one server are not isolated from each other, which gives security gaps in the presence of a neighbor - an attacker, or if the site of a neighbor is broken. Also, if there is a DDoS attack on a neighbor, or just a high load, everyone suffers.
In our old hosting, we solved the problem of an increased number of requests (which often rises no less acutely than DDoS attacks. Yes, hello) by installing frontend with Nginx, which works as a filtering proxy, for each group of web servers, thus we can balance the load on sites within the same server. But the problem with isolation remained, all sites work with php as mod apache, and still live in a single common space. It is sad.
What about this part of our new hosting? First, there is a different architecture in it, which is a cluster where the load is evenly distributed between the web servers. We use php via FastCGI, which gives us different UIDs on all websites, which is already good and safe. It’s also very cool that every web space is an LVE (Light Virtual Environment), a small virtual machine where all scripts work in isolation from other web space in their virtual space for which certain memory and processor resources are allocated. All this thanks to the Cloud Linux distribution:

Well, plus everything, you can also use Nginx. So with security in the new hosting is great.
2. Stability
The stability of the hosting is affected by the problems described in the previous paragraph. All users cook in the same pot and share resources. And stability puts at risk the fact that any systems tend to break down because of problems with hardware or software (for example, the Apache demon crashed) all the inhabitants of the problem server are left without hosting, is that terrible, right?
With our old hosting, everything is the same - shared resources, shared memory and processor time, such is the fee for the architecture - whatever one may say. But we have overcome the problem with iron by the fact that all our servers are virtualized, namely they are located in Parallels Virtuozzo containers. This is great, because if the server needs to be scaled and give it more resources, or it can be prevented by hardware, we simply transport the container to a more powerful server without downtime. If inside the container there is a problem with the software (well, who doesn’t happen to anyone?) Everyone is sitting without hosting until the technical department fixes the error, such things happen, if only for a few minutes, but still unpleasant for customers. They have a business, customers, visitors who will be upset if their site lays down even for a few minutes.
New hosting here gives odds to everyone. The LVE, about which it was mentioned in the previous paragraph, give clearly limited resources for each web space, what the client wanted - he will receive and will not be able to oppress the server neighbors either in the processor or in memory - this approach is closer to the VPS than to virtual hosting. And thanks to the cluster architecture, if one of the frontends flies out (they can be scaled horizontally anyway), then all requests will be distributed among other frontends. That is, even if hardware or software crashes on one of the web servers, the balancer will immediately remove the problem server from the cluster and redistribute the load between the remaining servers, and the client will never know that trouble has occurred on one of the servers. Such a solution due to its complete autonomy and automation makes the new hosting cheaper for us and as a result for you. As a result, we spend more time on new interesting things and ideas.
3. Convenience and speed
- The fourth generation hosting is more convenient and more pleasant for the end user with several points:
- Client files belong to the same UID as the files created by the web server. This eliminates the frequent inconvenience, it is easier to install CMS systems, for example, it is easier to install plugins and themes for Wordpress, since the Wordpress interface does not need to specify an FTP password, etc.
- Apache is now working in MPM Worker mode. Static requests in this mode are faster. The speed of content delivery will improve for most sites.
- Need more resources, but no desire to go to the VPS? Easily issue more memory or CPU time, we get excellent scalability.
A brief summary of the above:
Pros :
"Fair" sharing of resources, each site is assigned resources that it can not exceed

Security, all sites operate in separate LVEs and are isolated

Fault tolerance and stability, cluster architecture.

Scalability, management database “on the go” can change the resources allowed for your site

Speed, Apache works in MPM Worker mode.
Minuses :
There may be problems with FastCGI PHP mode for sites written at the beginning of the last decade. However, almost all modern engines and CMS support it natively and painlessly.

Due to the isolation of sites, no one will restrict your rights to resources, but on the other hand your site will not be able to get more resources than it is assigned to.
Testing.
We have just opened a public registration on a new hosting and we cannot wait to know your opinion about it, about the problems that you have. We will be happy to hear suggestions on the functionality of the hosting and control panel (which we, by the way, also changed).
You can test hosting for free for 3 months at the following link:
http://rusonyx.ru/r/4gPromotional code for Habr's readers:
RUSONYXHABR001Testing is over, thank you for your help in setting up and starting our new service!All questions and suggestions please contact technical support by mail at support@rusonyx.ru specifying the account number.
Waiting for you!