started · updated
Nginx Unit outperforms traditional web hosting stacks
Nginx Unit has demonstrated superior performance compared to traditional web hosting stacks in recent benchmarks. Testing conducted on AWS EC2 instances indicates that Nginx Unit performs approximately three times faster than the standard Nginx and PHP-FPM configuration.
In terms of resource efficiency, Nginx Unit maintains a significantly lower memory footprint than Apache mod_php. While Apache consumes roughly 100 MB of RAM for 25 threads, Nginx maintains a footprint of only 10 MB. The event-driven, asynchronous architecture of Nginx allows it to handle high concurrency more effectively than Apache, which relies on a process or thread per connection, leading to increased kernel context switching under heavy loads.
While other runtimes like FrankenPHP can achieve higher speeds in specific worker modes, Nginx Unit is noted as a lightweight alternative for dynamic environments. The benchmarks also highlight Nginx's ability to serve static files at a much higher rate than Apache, with Nginx serving 15,000 files per second compared to Apache's 3,000.
Entities
AWS · Apache · Nginx Unit · PHP-FPM