
3/18/2020 · Julien Desgats
What this post added
This post details the challenges of CPU-intensive tasks within an event-loop architecture, specifically for Cloudflare's Web Application Firewall (WAF). It explores solutions such as increasing worker processes, creating separate services, and offloading to thread pools. The chosen solution involves repurposing NGINX's existing thread pool mechanism to handle WAF processing, thereby freeing up the main event loop. The post highlights the use of the EPOLLROUNDROBIN flag to address load balancing issues and presents performance metrics demonstrating reduced TTFB and improved request acceptance latency after implementing this change.