Why Netflix chose NGINX

2023-11-04 02:48
文章标签 nginx netflix chose

本文主要是介绍Why Netflix chose NGINX,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

Why Netflix Chose NGINX as the Heart of Its CDN

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.

Gleb-Smirnoff-nginx.conf2014NGINX developer Gleb Smirnoff at nginx.conf2014

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.

Why Netflix Built Its Own CDN

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:

  • From a practical perspective, the CDN vendors were struggling to expand their infrastructure at a pace that matched the growth in customer demand for Netflix’s video streaming.
  • From a financial perspective, the expense of outsourcing was quickly becoming prohibitive as the volume of streamed video increased (a challenge experienced by many popular applications and web properties).
  • From a business perspective, it was clear that video streaming was replacing DVD lending as Netflix’s primary source of revenue, and it didn’t make sense to outsource a critical piece of the company’s main business.

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:

  • The user’s video player. Netflix already controlled this component, because its developers write all the device-specific apps used by customers to view Netflix content.
  • The network between the user and the Netflix servers. There is no way to control this component directly, but Netflix minimizes the network distance to its customers by providing free video-streaming appliances to ISPs in exchange for rack space in the ISP’s data centers for housing the appliances. (Appliances are also placed at Internet exchange points [IXPs] to serve customers whose ISPs are not interested in housing third-party equipment.) Video streaming is particularly sensitive to the packet delay and loss, misordered arrival, and unpredictable (jittery) round-trip times inherent to TCP/IP, and minimizing the network distance reduces the potential exposure to these anomalies.
  • The video server (Open Connect itself). Running its own CDN gives Netflix freedom to tune the CDN software to compensate for Internet anomalies as much as possible. It can run custom TCP connection-control algorithms and HTTP modules. It can also detect server and network problems very quickly and reroute clients to alternative servers, then log in to the server hardware and troubleshoot “from inside.”

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.

Why Netflix Chose NGINX and FreeBSD

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:

  • FreeBSD as the operating system, because it’s known to be fast and stable. The developer community is strong and willing to work with vendors.
  • 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:

  • NGINX’s event-driven design is one of the keys to its outstanding performance, and FreeBSD’s kqueueevent notification system call is one of best APIs for multiplexed I/O.
  • Without any modification required, NGINX can use the sendfile system call together with the aio_read system call. Together the calls avoid blocking on disk I/O, leading to outstanding performance.

NGINX Plus and NGINX Can Optimize Your Application Delivery, Too

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.

Video Recording


这篇关于Why Netflix chose NGINX的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/342681

相关文章

centos7基于keepalived+nginx部署k8s1.26.0高可用集群

《centos7基于keepalived+nginx部署k8s1.26.0高可用集群》Kubernetes是一个开源的容器编排平台,用于自动化地部署、扩展和管理容器化应用程序,在生产环境中,为了确保集... 目录一、初始化(所有节点都执行)二、安装containerd(所有节点都执行)三、安装docker-

使用Nginx来共享文件的详细教程

《使用Nginx来共享文件的详细教程》有时我们想共享电脑上的某些文件,一个比较方便的做法是,开一个HTTP服务,指向文件所在的目录,这次我们用nginx来实现这个需求,本文将通过代码示例一步步教你使用... 在本教程中,我们将向您展示如何使用开源 Web 服务器 Nginx 设置文件共享服务器步骤 0 —

一文带你搞懂Nginx中的配置文件

《一文带你搞懂Nginx中的配置文件》Nginx(发音为“engine-x”)是一款高性能的Web服务器、反向代理服务器和负载均衡器,广泛应用于全球各类网站和应用中,下面就跟随小编一起来了解下如何... 目录摘要一、Nginx 配置文件结构概述二、全局配置(Global Configuration)1. w

若依部署Nginx和Tomcat全过程

《若依部署Nginx和Tomcat全过程》文章总结了两种部署方法:Nginx部署和Tomcat部署,Nginx部署包括打包、将dist文件拉到指定目录、配置nginx.conf等步骤,Tomcat部署... 目录Nginx部署后端部署Tomcat部署出现问题:点击刷新404总结Nginx部署第一步:打包

Nginx、Tomcat等项目部署问题以及解决流程

《Nginx、Tomcat等项目部署问题以及解决流程》本文总结了项目部署中常见的four类问题及其解决方法:Nginx未按预期显示结果、端口未开启、日志分析的重要性以及开发环境与生产环境运行结果不一致... 目录前言1. Nginx部署后未按预期显示结果1.1 查看Nginx的启动情况1.2 解决启动失败的

tomcat在nginx中的配置方式

《tomcat在nginx中的配置方式》文章介绍了如何在Linux系统上安装和配置Tomcat,并通过Nginx进行代理,首先,下载并解压Tomcat压缩包,然后启动Tomcat并查看日志,接着,配置... 目录一、下载安装tomcat二、启动tomcat三、配置nginx总结提示:文章写完后,目录可以自动

Windows下Nginx的安装及开机启动

1、将nginx-1.16.1.zip解压拷贝至D:\web\nginx目录下。 2、启动Nginx,两种方法: (1)直接双击nginx.exe,双击后一个黑色的弹窗一闪而过。 (2)打开cmd命令窗口,切换到nginx目录下,输入命令 nginx.exe 或者 start nginx ,回车即可。 3、检查nginx是否启动成功。 直接在浏览器地址栏输入网址 http://lo

nginx介绍及常用功能

什么是nginx nginx跟Apache一样,是一个web服务器(网站服务器),通过HTTP协议提供各种网络服务。 Apache:重量级的,不支持高并发的服务器。在Apache上运行数以万计的并发访问,会导致服务器消耗大量内存。操作系统对其进行进程或线程间的切换也消耗了大量的CPU资源,导致HTTP请求的平均响应速度降低。这些都决定了Apache不可能成为高性能WEB服务器  nginx:

web群集--nginx配置文件location匹配符的优先级顺序详解及验证

文章目录 前言优先级顺序优先级顺序(详解)1. 精确匹配(Exact Match)2. 正则表达式匹配(Regex Match)3. 前缀匹配(Prefix Match) 匹配规则的综合应用验证优先级 前言 location的作用 在 NGINX 中,location 指令用于定义如何处理特定的请求 URI。由于网站往往需要不同的处理方式来适应各种请求,NGINX 提供了多种匹

nginx长连接的问题

转自: http://www.360doc.com/content/12/1108/17/1073512_246644318.shtml