Why is LEMP 5 times slower than LAMP?

Posted February 26, 2018 9.1k views
NginxLAMP StackLEMPUbuntu 16.04

I read many post on internet that LEMP + wordpress is faster than LAMP + wordpress. I installed lemp + wordpress using guides on digital ocean.

The results = Nginx is five time slower than apache!

I am not able to find a good solution to make lemp + wordpress work as good as lamp + wordpress.

If anyone knows a solution, help is appreciated.


These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
2 answers

HI! A few years back I was the person developing the DO WordPress one-click image and we had heard the same thing so we decided to do some testing ourselves to figure out whether LAMP or LEMP with a totally default Ubuntu provided configuration would perform better on small droplets.

In my testing I found:

LEMP was slightly slower serving WordPress on the smallest droplet sizes.
LEMP had slightly higher RAM use than Apache (likely due to the separate process required for fpm)

LAMP had slightly lower resource usage by default but seemed to lose this advantage with more connected clients.

My testing was exclusively about the default Ubuntu configurations on the smallest droplets for a very limited use case but in my experience with Nginx, it’s all about how you optimize your configuration.

Because LAMP uses mod_php and LEMP doesn’t have it, they are forced to use php-fpm, but in terms of speed there is nothing faster than mod_php (except lsphp).