📜 ⬆️ ⬇️

High-loaded jeans

In this article we will talk about how we, Getwear , solved the problem of the availability of our service from anywhere in the world with Internet. The described (and easily accessible for implementation) toolkit can be useful for owners of sites on any subject, intended for an audience from different countries.



After we launched the project (we already wrote about the problems with the creation of our site in our first article ), we faced new troubles - with the availability of the site in various countries of the world.
')
Our jeans are ordered in various countries: from a well-fed and prosperous Europe to barefoot Africa. But nobody wants to wait for the download of the Flash configurator. The content of our site was initially quickly loaded from the States (the server is located there), but at the same time it was loaded very slowly from Germany or Israel. Due to incomprehensible network fluctuations, we were losing customers, and we didn’t like that at all.

Initially, we chose expensive Canadian hosting, which promised almost a negative load time. But the site anyway slowly opened from Europe. Then we moved the service to an American server, which literally sat on a transatlantic cable, the other end of which rested in Germany. We assumed that the “thick” channel would help the configurator to load significantly faster. This again did not help.

It became clear that if we did not quickly solve the problem of accessibility, then the beautiful site and convenient configurator will not impress anyone - our potential buyers simply will not wait for them to load.

So we went to the clouds - the CDN network was the solution to the content delivery problem.

Technology CDN (content delivery network, content delivery network) is literally created for projects like Getwear, users of which live in different countries of the world and download "heavy" files like scripts, Flash and graphics from the site. The access speed is increased due to the fact that the content is loaded not directly from your main server, the ping to which can be far from ideal, but from one of the CDN servers selected by various principles, including geographic proximity to the user. We used the solution from Akamai , but there are other options.

Our server is located in the cloud Rackspace - this hosting not only provides the basic tools for working with Akamai, but also allows you to significantly increase the computing power when it becomes necessary. The functionality for working with CDN is called Rackspace Cloudfiles. Note that to use Cloudfiles it is not necessary to have a server in Rackspace, hosting can be located anywhere.

In general, the service connection looks like this:

1. To start, we create a “container” Akamai. There are no directories in it - all files are right in the root of the container.
2. For ease of use, create a container alias, since the container initially has a heavy and inconvenient URL like a0c3b42c5dfd0490222c-b6a09a90aa4d4b9ccff1b80f6958ce71.r25.cf2.rackcdn.com . Alias ​​(in our case static.getwear.com) is created by writing a link to it in the server’s DNS settings.
3. Fill our content into the container - either through the not-too-convenient web interface of Rackspace itself, or using a special client like Cyberduck . For the client to work, you need to enter a login from Rackspace and Rackspace API ID (you can find it in Your Account → API Access menu).
4. Put links to the content from the container on the site (for example, static.getwear.com/1.swf).
five. …
6. PROFIT!

Now the cloud itself locates the user and loads heavy content from the server Akamai closest to it.

This solution has one minus and several advantages.

Minus:

Like everyone else in this world, CDN solutions cost money - Rackspace has a disk space cost of 10 cents per gigabyte per month, and traffic at 18 cents per gigabyte. Prices are significantly reduced depending on the volume of resources consumed.

Pros:

1. For most standard platforms (Wordpress, Drupal, etc.) there are ready-made interaction modules with Akamai.
2. For other sites there are various APIs , the integration of which does not take much time. In this we have seen on their own experience.
3. The system easily withstands high loads. Where the usual dedicated hosting simply falls, Akamai does not even slow down.
4. Savings on payment of traffic. Despite the fact that the use of the service costs money, the fees charged are usually lower than the cost of traffic on a regular dedicated hosting.
5. For most projects, CDN is one of the most convenient ways to organize the delivery of heavy content to “distributed” users.

Of course, this example does not solve absolutely all the problems with the availability of the site. After all, as you know, “the routing paths are inscrutable.” And besides the problems of delivering the content itself, the bottleneck can be both the quality of the code of the site itself and the quality of the hosting itself, along with the software settings on it. Nevertheless, the use of CDN - a fairly simple solution that is accessible to everyone and easily implemented, can be the first step towards the further development of your project.

Do you have experience with CDN-services? What can you recommend or recommend?

Source: https://habr.com/ru/post/152062/


All Articles