For a long time, the traffic system between users and end servers based on Nginx satisfied the needs of Cloudflare, but with an increase in the network and increasing its complexity of universal solution, it was not enough, both in terms of performance and expansion and implementation restrictions and implementation new opportunities for customers. In particular, difficulties arose in adding functionality that goes beyond a simple gateway and a load balancer. For example, it became necessary to re-send a request to another server in the event of a processing of processing a request by a server, supplying it with another set of HTTP-heads.
Instead of the architecture with the separation of requests for individual processing processes (Worker), a multi-flow model has been used in Pingora, which showed a more efficient distribution of resources between CPU nuclei (linking requests to processes in NGINX led to an unbalanced load on the CPU nuclei, as a result of which resource-consuming loads Requests and blocking input-output slowed down the processing of other requests). In addition, the binding of a console pool to processing processes did not allow to achieve the full reuse of compounds already established by the server (the compounds are re-used only within the current processing process, which reduces the efficiency of work with a large number of processing processes).
nginx:
pingora:
The implementation of Pingora made it possible to reduce the number of operations of the installation of new connections by 160 and increase the share of re -used requests from 87.1% to 99.92%. In addition to reducing repeated compounds and more efficient use of CPU nuclei, increasing the productivity of the new proxy was also facilitated by getting rid of slow -made processors used with NGINX in Lua.