Introducing Proxygen, Facebook’s C++ HTTP framework

Visit the post for more.

Daniel Sommermann
8 min readintermediate
--
View Original

Overview

Proxygen is a high-performance C++ HTTP framework developed by Facebook, designed to facilitate the creation of HTTP services with sensible defaults. It supports protocols like HTTP/1.1, SPDY/3, and is evolving to include HTTP/2, focusing on integration, performance, and ease of use.

What You'll Learn

1

How to integrate Proxygen into existing applications for high-performance HTTP services

2

Why Proxygen was developed instead of using existing HTTP servers like Apache or nginx

3

How to leverage Proxygen's architecture for supporting new protocols like HTTP/2

Prerequisites & Requirements

  • Understanding of HTTP protocols and C++ programming

Key Questions Answered

What are the main features of Proxygen?
Proxygen supports HTTP/1.1, SPDY/3, and is developing HTTP/2 support. It is designed for high performance and ease of integration into existing applications, unlike traditional servers like Apache or nginx, which prioritize configurability over performance.
How does Proxygen's architecture support new protocols?
Proxygen's architecture is built around a four-part abstraction: session, codec, transaction, and handler. This design allows for the easy addition of new multiplexing protocols like SPDY and HTTP/2 without duplicating code.
What performance metrics were achieved with Proxygen's echo server?
The echo server was benchmarked on a 32 logical core Intel Xeon CPU E5-2670 with 16 GiB of RAM, achieving high performance with various worker thread configurations. Specific performance numbers were not detailed, but it demonstrated the efficiency of binary protocols like SPDY and HTTP/2.

Key Statistics & Figures

Echo server benchmark performance
Achieved high performance with varying worker threads
Tested on a 32 logical core Intel Xeon CPU E5-2670 with 16 GiB of RAM

Technologies & Tools

Some links below are affiliate links. We may earn a commission if you make a purchase.

Programming Language
C++
Used to develop the Proxygen framework
Software Library
Thrift
Provides underlying network and data abstractions for Proxygen
Software Library
Folly
Used for additional data abstractions in Proxygen

Key Actionable Insights

1
Integrate Proxygen into your existing C++ applications to enhance HTTP service performance.
By using Proxygen, developers can leverage its high-performance capabilities and sensible defaults, which can lead to faster deployment of HTTP services.
2
Utilize Proxygen's architecture to experiment with new HTTP protocols like HTTP/2.
This flexibility allows teams to quickly implement and test new features, improving their ability to adapt to changing requirements.
3
Take advantage of Proxygen's integration with Facebook's internal tools for monitoring and administration.
This integration simplifies operational overhead and enhances the ability to track performance metrics effectively.

Common Pitfalls

1
Overcomplicating HTTP server configurations can lead to performance issues.
Developers should focus on using Proxygen's sensible defaults to avoid unnecessary complexity that can hinder performance.

Related Concepts

HTTP/2
Spdy
C++ Programming
Event-driven Architecture