Highly loaded jeans

    This article will discuss how we, Getwear , solved the problem of the availability of our service from anywhere in the world where the Internet is. The described (and easily accessible for implementation) toolkit can be useful for website owners of any subject, designed for an audience from different countries.



    After we launched the project (we already wrote about the problems with creating our site in our first article ), we ran into new troubles - the availability of the site in different countries of the world.

    Our jeans are ordered in a wide variety of countries: from a well-fed and prosperous Europe to barefoot Africa. But nobody wants to wait for the Flash configurator to load. The content of our site was initially quickly loaded from the United States (the server is located there), but it was very slowly loaded from Germany or Israel. Due to incomprehensible network fluctuations, we lost customers, and we did not like it at all.

    Initially, we chose an expensive Canadian hosting, which promised almost negative load times. But the site still slowly opened from Europe. Then we transferred 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 boot significantly faster. This did not help again.

    It became clear that if we do not quickly solve the problem of accessibility, then a beautiful website and a convenient configurator will not impress anyone - our potential customers simply will not wait for their download.

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

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

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

    In general, a service connection looks like this:

    1. First, we create an Akamai “container”. There are no directories in it - all the files are right in the root of the container.
    2. For ease of use, we create an alias of the container, since initially the container has a heavy and inconvenient URL like a0c3b42c5dfd0490222c-b6a09a90aa4d4b9ccff1b80f6958ce71.r25.cf2.rackcdn.com. We create Alias ​​(in our case static.getwear.com) by registering a link to it in the server’s DNS parameters.
    3. Pour our content into the container - either through the not very convenient web interface of Rackspace itself, or using a special client such as Cyberduck . For the client to work, you will need to enter a login from Rackspace and Rackspace API ID (it can be found in the menu Your Account → API Access).
    4. We put on the website links to content from the container (for example, static.getwear.com/1.swf).
    5. ...
    6. PROFIT!

    Now the cloud itself determines the user's location and loads heavy content from the Akamai server closest to it.

    This solution has one minus and several advantages.

    Minus:

    Like everything in this world, CDN solutions cost money - at Rackspace, disk space costs start at 10 cents per gigabyte per month, and traffic starts at 18 cents per gigabyte. Prices are significantly reduced depending on the amount of resources consumed.

    Pros:

    1. For most standard platforms (Wordpress, Drupal, etc.) there are ready-made modules for interacting with Akamai.
    2. For other sites, there are various APIs , the integration of which will not take much time. We have seen this from our own experience.
    3. The system easily withstands high loads. Where the usual dedicated hosting will simply lie down, Akamai will not even slow down.
    4. Saving on traffic costs. Despite the fact that using the service costs money, the fee charged is usually lower than the cost of traffic on a shared 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, the above example does not solve absolutely all problems with the availability of the site. After all, as you know, “routing paths are inscrutable”. And besides the problems of delivering the actual content, the bottleneck can be both the quality of the code of the site itself and the quality of the hosting itself, together with the software settings on it. Nevertheless, the use of CDN is a fairly simple solution, 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 advise or recommend?

    Also popular now: