The Need for Speed: Why Cloudflare Ditched NGINX for Pingora
Cloudflare, a global leader in web security and performance, has recently made headlines by bidding farewell to the tried and tested NGINX and introducing its in-house proxy, Pingora. The result?
A remarkable boost in speed that translates into saving users a staggering 434 years of handshake time every single day.
So, what makes Pingora outpace NGINX? The secret lies in its approach to handling web requests. Unlike NGINX’s multiprocess approach, which assigns each request to a single worker, Pingora has adopted multithreading.


Multi-Threading Over Multi-Processing
This means that each request is no longer confined to a solitary worker. Instead, Pingora efficiently shares connections across threads, leading to a significantly improved connection reuse ratio. Say goodbye to the extended TCP and TLS handshakes that have long been the bane of web performance!
Why Multithreading Trumps Multiprocessing:
Let us break it down with a simple example.
Grocery Shop Example
Imagine a bustling grocery store with multiple checkout counters, customers patiently lining up to pay for their items, and the pressing need to manage these queues efficiently.
- Multiprocessing Approach: In this scenario, each checkout counter operates as an independent process. Each counter possesses its own set of resources, including cashiers, cash registers, and dedicated queues of customers — the Separate Queue Model . While this method indeed provides isolation, it comes at a cost — it is resource-intensive, and it is not easily Scalable. If one cashier gets blocked, it can cause delays for customers in that queue, leading to potential maximum latency issues for the whole system.

- Multithreading Approach: In this scenario, all checkout counters (e.g., Cashier 1, Cashier 2, Cashier 3) operate within a single process. Here, customers form a single queue shared among multiple cashiers — Combined Queue Model. Just like the one, You see in the airport ? This approach minimizes maximum latency, as any delays at one cashier don’t significantly affect the entire system. Each checkout counter is represented as a separate thread within that process.
With the adoption of multithreading, Pingora is setting new standards for connection reuse and web performance. There are more reasons why Cloudflare adopted Pingora which is out of scope for this article as of now. Stay Tuned.
Image Reference:
https://blog.cloudflare.com/how-we-built-pingora-the-proxy-that-connects-cloudflare-to-the-internet/