炖汤用什么锅比较好| 减肥为什么让早上空腹喝咖啡| 神仙眷侣是什么意思| 四川是什么气候| 乙肝三抗体阳性是什么意思| 痛风可以吃什么肉类和蔬菜| 尿酸盐结晶是什么意思| 珍珠纱是什么面料| 怀孕梦见蛇是什么意思| 菁字五行属什么| 情未了什么意思| 蜂窝数据什么意思| ipa啤酒是指什么| 马瘦毛长是什么意思| 什么锅好| 花肠是母猪的什么部位| 爬虫什么意思| 拉肚子是什么原因引起的怎么办| 98年虎是什么命| 什么钙片补钙效果好| 第一次查怀孕挂什么科| 提手旁的字与什么有关| 结售汇是什么意思| 辣椒是什么科| 戴菊是什么| 上传下达什么意思| 有什么水能代替美瞳水| 旧加一笔是什么字| hpv检查前需要注意什么| 西多士是什么| 低频是什么意思| 基因是什么意思| 忍耐是什么意思| 送产妇什么礼物最合适| 甲状腺用什么药| 刘邦为什么怕吕后| 吃地瓜有什么好处| 晚上睡觉磨牙是什么原因| 为什么会得hpv| 7.16什么星座| 钙片是什么意思| 压寨夫人是什么意思| 狗狗感冒了吃什么药| 让我随你去让我随你去是什么歌| 尿液细菌高是什么原因| 什么不可当| 渃是什么意思| 残骸是什么意思| 澈是什么意思| 夸瓜读什么| 花心什么意思| 680分能上什么大学| 枸杞加红枣泡水喝有什么功效| 专项变应原筛查是什么| saba是什么药| 什么是性| 浅绿色是什么颜色| 眩晕症吃什么药| 认知障碍是什么意思| 午时是什么时候| 白头发多吃什么食物能变黑| 碳酸氢根偏低什么意思| 杨梅不能与什么同吃| 小孩脾胃虚弱吃什么药| 左眼皮跳是什么原因| 心脏早搏什么症状| 床咚是什么意思啊| 随波逐流什么意思| 食管裂孔疝是什么意思| 吃什么能快速补血| 子宫直肠凹积液是什么意思| 三七粉主治什么病| 笙箫是什么意思| 十月份生日是什么星座| 喝什么茶能减肥| p波增宽是什么意思| 仰卧起坐是什么现象| 嘴发麻是什么原因引起的| 血管炎是什么病| 蒸馏水敷脸有什么作用| 什么样的山峰| 什么木头做菜板好| 什么粥最养胃| 吃什么补充膝盖润滑液| 孕妇佩戴什么保胎辟邪| 印度阿三是什么意思| 痣长在什么地方不好| 为什么总想睡觉| 什么东西养胃| 什么是盗汗| 狗狗不能吃什么水果| 北京的市花是什么花| 一阴一阳是什么数字| 养血清脑颗粒治什么病| 晚上吃什么水果对身体好| 喜大普奔是什么意思| 波子是什么车| 整天放屁是什么原因| 肺坠积性改变什么意思| 荣字五行属什么| 男人后背有痣代表什么| 鄙人不才是什么意思| 反馈是什么意思| 抗坏血酸是什么| 肌肉痛吃什么药| 血小板低是什么引起的| 红色象征什么| 什么心竭什么| 豹纹守宫吃什么| 6月19什么星座| 翻糖蛋糕是什么意思| 车震是什么意思啊| 有什么好吃的菜| image是什么意思| 临床医学学什么| 10月13是什么星座| 塬字五行属什么| 钼靶检查是什么| 牙缝越来越大是什么原因| 糖尿病可以吃什么肉| 什么的猫| 蚂蚁吃什么食物| 睾丸变小了是什么原因| 牙疼什么原因| 麦麸是什么意思| 住院医师是什么意思| 孕妇奶粉什么时候开始喝最好| 小鸟喜欢吃什么食物| 辣木籽有什么功效| 脑梗有什么前兆| 头上长虱子什么原因引起的| 舌头有麻木感什么原因| 6.20什么星座| 波尔多红是什么颜色| 新生儿湿疹用什么药膏| 铂金什么颜色| 虾吃什么| 脊椎和脊柱有什么区别| 菊花什么颜色| 如日中天的意思是什么| 114是什么意思| 胎方位roa是什么意思| 去角质是什么意思| 腿疼是什么原因| 克是什么意思| 梅花什么时候开花| 9.22什么星座| 五经指什么| 漆皮是什么皮| 市局副局长什么级别| 用减一笔是什么字| 女性安全期是什么时候| 羊内腰和外腰分别是什么| 刘备是什么样的人| 看结石挂什么科室| 3月7日是什么星座| 为什么女人阴唇会变黑| 属鼠的贵人是什么属相| 焦是什么意思| 爰是什么意思| 上海是什么省| 天秤座男生喜欢什么样的女生| 足癣用什么药| 现役是什么意思| 台湾人说什么语言| 什么山不能爬脑筋急转弯| 为什么会反胃想吐| 眼底检查主要查什么| 梦到绿色的蛇是什么意思| 陈醋与香醋有什么区别| 肌酐高是什么原因| 割包皮是什么意思| 什么是农历| 梦见磕头下跪什么意思| 老梗是什么意思| 四大皆空是什么生肖| 病毒感染咳嗽吃什么药效果好| 谷什么意思| 米干是什么| 做牛排用什么部位的牛肉| 浙江大学什么专业最好| 尿白细胞定量高是什么意思| 华山在什么地方| 扬州瘦马什么意思| 临字五行属什么| 上窄下宽的脸型适合什么发型| 一什么月牙| roca是什么品牌| 起水泡痒是什么原因| 牙疼是什么火引起的| 片状低回声区什么意思| 情人和小三的区别是什么| 小孩晚上睡觉磨牙是什么原因| 为什么喝咖啡会心慌| 羹什么意思| 舒张压偏高是什么原因造成的| 炖猪蹄放什么调料| 青苹果什么时候成熟| 月嫂下户是什么意思| 王不见王是什么意思| 代肝是什么意思| 宫腔镜是什么意思| 手指头发麻是什么原因引起的| 刘备的儿子叫什么| 氟是什么东西| 十二指肠球炎是什么意思| 50pcs是什么意思| 梦见亲人去世是什么意思| 拍肺部ct挂什么科| 什么叫自负| 什么叫牙周炎| 相敬如宾是什么意思| 西米是什么东西| 男人梦见蛇是什么意思| 猪精是什么| dht是什么| 咖啡加奶叫什么| 肥达氏反应检查什么病| 抗hcv是什么意思| 尿液里白细胞高是什么原因| 泌尿科主要看什么病| 禁果什么意思| 主是什么结构的字体| 术后血压低什么原因| 什么是子宫腺肌症| 大便化验隐血阳性什么意思| 胆酷醇高有什么危害| 为什么会高反| 冲正是什么意思| 京畿是什么意思| 慢性鼻窦炎吃什么药| 急于求成是什么意思| 啤酒喝了有什么好处| 户名是什么意思| 前列腺炎有什么征兆| 腿胖是什么原因引起的| 切尔斯什么意思| 低蛋白血症是什么病| 碘是什么| 膝关节积液吃什么药| 脸颊两边长斑是什么原因| 什么食物利尿| 秘鲁说什么语言| 翘嘴鱼是什么鱼| 扁桃体2度是什么意思| 什么叫感性的女人| 1935年属什么生肖| 肺胃热盛吃什么中成药| 当逃兵会有什么后果| 喉咙上火吃什么药| 总打嗝吃什么药| 恒心是什么意思| 什么地笑| 霍光和卫子夫什么关系| 福建为什么叫八闽| 眉心长痘痘什么原因| 用什么泡脚减肥最快| 罗非鱼吃什么| 小沈阳属什么生肖| 宫外孕术后可以吃什么| 月亮像什么的比喻句| 酷盖是什么意思| 花生属于什么类| 尚清是什么意思| 百度

We are excited to announce the release of Proxygen, a collection of C++ HTTP libraries, including an easy-to-use HTTP server. In addition to HTTP/1.1, Proxygen (rhymes with "oxygen") supports SPDY/3 and SPDY/3.1. We are also iterating and developing support for HTTP/2.

Proxygen is not designed to replace Apache or nginx — those projects focus on building extremely flexible HTTP servers written in C that offer good performance but almost overwhelming amounts of configurability. Instead, we focused on building a high performance C++ HTTP framework with sensible defaults that includes both server and client code and that's easy to integrate into existing applications. We want to help more people build and deploy high performance C++ HTTP services, and we believe that Proxygen is a great framework to do so. You can read the documentation and send pull requests on our Github site.

Background

Proxygen began as a project to write a customizable, high-performance HTTP(S) reverse-proxy load balancer nearly four years ago. We initially planned for Proxygen to be a software library for generating proxies, hence the name. But Proxygen has evolved considerably since the early days of the project. While there were a variety of software stacks that provided similar functionality to Proxygen at the time (Apache, nginx, HAProxy, Varnish, etc), we opted go in a different direction.

Why build our own HTTP stack?

  • Integration.The ability to deeply integrate with existing Facebook infrastructure and tools was a driving factor. For instance, being able to administer our HTTP infrastructure with tools such as Thrift simplifies integration with existing systems. Being able to easily track and measure Proxygen with systems like ODS, our internal monitoring tool, makes rapid data correlation possible and reduces operational overhead. Building an in-house HTTP stack also meant that we could leverage improvements made to these Facebook technologies.
  • Code reuse. We wanted a platform for building and delivering event-driven networking libraries to other projects. Currently, more than a dozen internal systems are built on top of the Proxygen core code, including parts of systems like Haystack, HHVM, our HTTP load balancers, and some of our mobile infrastructure. Proxygen provides a platform where we can develop support for a protocol like HTTP/2 and have it available anywhere that leverages Proxygen's core code.
  • Scale. We tried to make some of the existing software stacks work, and some of them did for a long time. Operating a huge HTTP infrastructure built on top of lots of workarounds eventually stopped scaling well for us.
  • Features.There were a number of features that didn't exist in other software (some still don't) that seemed quite difficult to integrate in existing projects but would be immediately useful for Facebook. Examples of features that we were interested in included SPDY, WebSockets, HTTP/1.1 (keep-alive), TLS false start, and Facebook-specific load-scheduling algorithms. Building an in-house HTTP stack gave us the flexibility to iterate quickly on these features.

Initially kicked off in 2011 by a few engineers who were passionate about seeing HTTP usage at Facebook evolve, Proxygen has been supported since then by a team of three to four people. Outside of the core development team, dozens of internal contributors have also added to the project. Since the project started, the major milestones have included:

  • 2011 – Proxygen development began and started taking production traffic
  • 2012 – Added SPDY/2 support and started initial public testing
  • 2013 – SPDY/3 development/testing/rollout, SPDY/3.1 development started
  • 2014 – Completed SPDY/3.1 rollout, began HTTP/2 development

There are a number of other milestones that we are excited about, but we think the code tells a better story than we can.

We now have a few years of experience managing a large Proxygen deployment. The library has been battle-tested with many, many trillions of HTTP(S) and SPDY requests. Now we've reached a point where we are ready to share this code more widely.

Architecture

The core HTTP layer is split into a four-part abstraction: the session, the codec, the transaction, and the handler. For each connection, a session is created. Each session has a codec, which is a protocol-specific framing object for serializing and de-serializing HTTP messages. The session is responsible for mapping each message from the codec to a particular HTTP transaction. Finally, the user of the library implements a handler that registers for HTTP-specific callbacks from a single transaction. This design has allowed us to support new multiplexing protocols like SPDY and HTTP/2 without having to duplicate code. You can see more detailed architecture diagrams in the project README.

Proxygen makes heavy use of the latest C++ features and depends on Thrift and Folly for its underlying network and data abstractions. We make use of move semantics to avoid extra copies for large objects like body buffers and header representations while avoiding typical pitfalls like memory leaks. Additionally, by using non-blocking IO and Linux's epoll under the hood, we are able to create a memory and CPU efficient server.

HTTP Server

The server framework we've included with the release is a great choice if you want to get set up quickly with a simple, fast-out-of-the-box event driven server. With just a few options, you are ready to go. Check out the echo server example to get a sense of what it is like to work with. For fun, we benchmarked the echo server on a 32 logical core Intel(R) Xeon(R) CPU E5-2670 @ 2.60GHz with 16 GiB of RAM,* *varying the number of worker threads from one to eight. We ran the client on the same machine to eliminate network effects, and achieved the following performance numbers.

    # Load test client parameters:
    # Twice as many worker threads as server
    # 400 connections open simultaneously
    # 100 requests per connection
    # 60 second test
    # Results reported are the average of 10 runs for each test
    # simple GETs, 245 bytes of request headers, 600 byte response (in memory)
    # SPDY/3.1 allows 10 concurrent requests per connection
  

While the echo server is quite simple compared to a real web server, this benchmark is an indicator of the parsing efficiency of binary protocols like SPDY and HTTP/2. The HTTP server framework included is easy to work with and gives good performance, but focuses more on usability than the absolute best possible performance. For instance, the filter model in the HTTP server allows you to easily compose common behaviors defined in small chunks of code that are easily unit testable. On the other hand, the allocations associated with these filters may not be ideal for the highest-performance applications.

Impact

Proxygen has allowed us to rapidly build out new features, get them into production, and see the results very quickly. As an example, we were interested in evaluating the compression format HPACK, however we didn't have any HTTP/2 clients deployed yet and the HTTP/2 spec itself was still under heavy development. Proxygen allowed us to implement HPACK, use it on top of SPDY, and deploy that to mobile clients and our servers simultaneously. The ability to rapidly experiment with a real HPACK deployment enabled us to quickly understand performance and data efficiency characteristics in a production environment. As another example, the internal configuration systems at Facebook continue to evolve and get better. As these systems are built out, Proxygen is able to quickly take advantage of them as soon as they're available. Proxygen has made a significant positive impact on our ability to rapidly iterate with our HTTP infrastructure.

Open Source

The Proxygen codebase is under active development and will continue to evolve. If you are passionate about HTTP, high performance networking code, and modern C++, we would be excited to work with you! Please send us pull requests on GitHub.

We're committed to open source and are always looking for new opportunities to share our learnings and software. The traffic team has now open sourced Thrift as well as Proxygen, two important components of the network software infrastructure at Facebook. We hope that these software components will be building blocks for other systems that can be open sourced in the future.

Thanks to all the engineers who have contributed to this project, including Ajit Banerjee, David Gadling, Claudiu Gheorghe, Rajat Goel, Peter Griess, Martin Lau, Adam Lazur, Noam Lerner, Xu Ning, Brian Pane, Praveen Kumar Ramakrishnan, Adam Simpkins, Viswanath Sivakumar, and Woo Xie.

Leave a Reply

To help personalize content, tailor and measure ads and provide a safer experience, we use cookies. By clicking or navigating the site, you agree to allow our collection of information on and off Facebook through cookies. Learn more, including about available controls: Cookie Policy

七月七是什么星座 美业是做什么的 你算个什么东西 人大副主任是什么级别 为什么梦不到死去的亲人
孕妇可以吃什么感冒药 风水宝地是什么意思 卵巢保养吃什么好 开平方是什么意思 女生安全期什么意思
查贫血挂什么科 超五行属什么 猫肉为什么不能吃 胰腺的作用和功能是什么 爽约什么意思
为什么放生泥鳅果报大 菜板买什么材质的好 什么时候立冬 什么是基因突变 琼瑶剧是什么意思
哥斯拉是什么动物hcv8jop8ns8r.cn 甲状腺结节吃什么好hcv8jop1ns9r.cn 汤去掉三点水念什么hcv9jop4ns8r.cn 11月11日什么星座96micro.com 一什么圆月hcv9jop0ns3r.cn
血尿是什么病jasonfriends.com 身上经常痒是什么原因hcv8jop1ns5r.cn 大校军衔相当于什么官hcv8jop9ns1r.cn 吉尼斯是什么意思hcv9jop0ns3r.cn 病毒发烧吃什么药hcv8jop2ns3r.cn
五七是什么意思有什么讲究hcv8jop0ns7r.cn 金鱼藻是什么植物hcv8jop1ns6r.cn 1989年属什么生肖hcv8jop7ns2r.cn 浊是什么意思hcv7jop6ns2r.cn 小狗什么时候可以洗澡hcv9jop2ns1r.cn
孕妇喝椰子水有什么好处hcv9jop4ns4r.cn rna是什么意思hcv9jop7ns3r.cn 心率早搏是什么意思hcv8jop4ns5r.cn 心慌吃什么药效果好hcv8jop3ns2r.cn 七月八日是什么星座hcv9jop3ns5r.cn
百度