Why video hosting is so expensive
Of all the types of static files used on websites, the most stringent hosting requirements are related to videos:
- Styles, images, and especially scripts delay the page's readiness for use, so the response time is important. On the other hand, the sizes of such files are usually small, the cacheability is good, the partial load is not important.
- Video files are large, cacheability is bad (most viewers watch a particular video for the first time), while the user may want to watch an arbitrary part of the video. On the other hand, the speed of delivery is important so that the video can be viewed without interruption for buffering.
- Downloadable software is relatively large, but the speed of delivery is not as critical as in the case of video.
Renting servers for video hosting in the USA is much cheaper (for outgoing gigabytes) than in many other countries. However, the delivery of video from American servers to other continents is rarely fast enough so that the film can be watched without interruption for buffering, and the waiting time before starting playback is acceptable. Therefore, the owners of sites with videos that go to an international audience have to rent local servers in different parts of the world closer to their users. Showing a video to a user from Russia, for example, costs a typical video site several times more expensive than showing the same video to an American. It is necessary either to pay more or reduce the quality of the video for foreign viewers. So go after that on the international market.
To solve this problem, we had to make the software smarter.
')

What is a typical static file server? Open the requested file in the right place and send it to the channel. A typical video player running in a browser? Request a file from the desired location, wait for some minimum buffer filling, show the video, while continuing to load it. If the buffer is empty, wait for filling.
Five servers instead of one
The
Hola CDN technology makes improvements to both client and server software. The player running in the browser downloads videos not from one, but from five different servers. One of them is the very reliable, close to the user, but expensive server, which I wrote about above. It belongs to the CDN, which our customer used before us. The remaining four are selected from the pool of servers that Hola rents from various virtual server providers where it is cheaper - in the USA, France, and the Netherlands.


It is important for the user that video playback starts as early as possible. Therefore, the first fragment at the beginning of the video or after the jump forward is downloaded from an expensive and fast server. But the remaining fragments are uploaded from Hola CDN servers. Due to the geographical location of the user, these fragments may load longer than the playback time, and one of the secondary servers may be completely unavailable. But smart client software can download fragments from different servers in parallel, and also eliminate the use of inaccessible servers. As a result, most of the video file is loaded in parts from cheap servers, and then unnoticed by the viewer is glued into a continuous video stream. The client code continuously measures the load indicators from different servers and makes decisions about where to download each next fragment and how many fragments you need to keep in store.
In addition, the client code Hola CDN quality caches downloaded fragments of the video. Even if the viewer does that jumps back and forth over a long film, not one of the already downloaded fragments will have to be downloaded again, as often happens with most of the current web players.
As for the Hola CDN servers, they are smart mirrors. They download from the primary CDN and store copies of popular video files, and fragmentary.
Other traffic saving measures
Another important measure aimed at reducing hosting costs is not to upload too many videos for future use. Very often the user does not watch the video to the end. At the same time, most web players download as much as they can download, and if the user has a fast connection, they may well have time to download the entire video in the time that the user looks at the quarter and decides not to watch further. Our player downloads only a limited length of video, sufficient for uninterrupted playback. The last two functions are available for free and save traffic even to those who do not use Hola CDN servers.
Hola CDN can work both in browsers with HTML5 video support, and in those where you still have to use Flash to play videos. We recommend customers to own Hola Player, built on the basis of
video.js , but we can work with
JW Player , as well as with any player based on HTML5. We use
Media Source Extensions technology in order to supply HTML5 video player with individually downloaded fragments.
Play around
For Habr's readers, for the first time we publish a link to our
internal tool for testing client code on various combinations of players, formats and usage scenarios. Welcome, you can play! Naturally, we do not guarantee that all this works, that it will not change in the future, and that we will not decide to remove this page at all. Many combinations there definitely do not work, and some even impossible theoretically at all.
Come to us
We already have the first satisfied customers, while many other potential customers are in the process of adjustment and testing. We still have a lot to do: add support for live video streams, various video formats, players ... Therefore, we
need good programmers . The work is remote (or in the office, if you live in Israel), the schedule is more flexible, high earnings. Our selection from the test task to the successful completion of the probationary period is on average one out of 250 candidates. You should know perfectly well the JS that we use on both the client and the server.
If you are interested in working at Hola, or you know someone who can approach us, write to me at
alexey@hola.org . If you bring someone who qualifies and works with us for the first three months,
we will pay you 7000 USD .