In the few years since its introduction, Netflix’s online video streaming service has grown to serve over 50 million subscribers in 40 countries. We’ve already shared some of the best practices that Netflix’s software development engineers adopted as they transitioned from a traditional monolithic development process to continuous delivery and microservices, in Adopting Microservices at Netflix: Lessons for Architectural Design and Adopting Microservices at Netflix: Lessons for Team and Process Design.
In this post, we’ll discuss another core contributor to Netflix’s success: its content delivery network (CDN), Open Connect. We’re proud that NGINX runs on every Open Connect delivery appliance, playing a key role in Netflix’s ability to keep pace with the explosive growth of the video service. NGINX’s Gleb Smirnoff has worked alongside the Open Connect team for over two years, and last October at our user conference, nginx.conf2014, he explained why Netflix chose NGINX (along with FreeBSD) to power this crucial part of its business.
Netflix initially outsourced streaming video delivery to three large CDN vendors (Akamai, Level3, and LimeLight). As the service became more popular, Netflix decided that building and managing its own CDN made sense, for several reasons:
Most importantly, Netflix built its own CDN in order to have greater control over application delivery and the user experience. To provide optimal streaming media delivery to customers, Netflix needed to maximize its control over the three basic components in the delivery chain:
Netflix was able to optimize Open Connect for video streaming in a way that’s not possible with a generic CDN provided by a vendor. Open Connect enables Netflix to offer a superior user experience at a lower cost, and with greater visibility into the performance of the application around the world.
From the start, Netflix’s goal was, as Gleb puts it, to “get more and more gigabits per second from a single box.” Specifically, Netflix needed to maximize the number of subscribers each appliance could serve concurrently. The Open Connect engineers anticipated needing to fine-tune the software to achieve this goal, so they decided to go with open source software for its unlimited extensibility.
As mentioned previously, Netflix places its video-streaming appliances in the data centers of its customers’ ISPs when possible. Because the software running on the appliances would be in the hands of third parties, Netflix chose projects that use a BSD-style license rather than the GNU Public License (GPL).
The specific open source projects Netflix chose were:
NGINX as the streaming media server. Its proven speed and stability was important because Netflix wanted to launch Open Connect as quickly as possible, without the need to tweak it just to get going. Once the CDN was up and running, Netflix was able to examine traffic patterns and fine-tune the NGINX settings.
Another benefit of NGINX is that although the open source software is distributed under a BSD-style license, all of its core developers are full-time employees of NGINX, Inc., which provides enterprise-class support for its commercial product, NGINX Plus. In this regard, it combines the best features of OSS and commercial software.
NGINX’s flexible framework for running custom modules also appealed to Netflix, and the Open Connect team has created modules specific to its video streaming needs.
Combining FreeBSD and NGINX yields further benefits:
kqueue
event notification system call is one of best APIs for multiplexed I/O.sendfile
system call together with the aio_read
system call. Together the calls avoid blocking on disk I/O, leading to outstanding performance.From its inception, NGINX was designed to be adaptable and support every aspect of application delivery. To make applications similar to Netflix easier for our commercial customers to deploy, NGINX Plus combines web serving, load balancing, content caching, and media streaming in one easy to use package. Check out how our case studies to learn how other leading companies use NGINX Plus to deliver their applications with performance, security, and scale.
We enjoy working closely with customers, providing guidance on how to get the most out of NGINX Plus in their specific application delivery architectures. Our Support and Professional Services teams can help you with architectural guidance, installation, configuration, updates, and more. Contact us to learn more.
"This blog post may reference products that are no longer available and/or no longer supported. For the most current information about available F5 NGINX products and solutions, explore our NGINX product family. NGINX is now part of F5. All previous NGINX.com links will redirect to similar NGINX content on F5.com."