What Is The Difference Between a LAMP and a LEMP Stack?

By Rob
13th September 2022

What is a LAMP stack?

Many people in the IT World are familiar with the acronym, LAMP – which stands for Linux, Apache, MySQL and PHP. A LAMP stack is synonymous with the PHP frameworks Laravel and Symfony, both gaining increasing popularity throughout the last few years as powerhouses for web sites across the world.

Few people are aware that there is an alternative to LAMP, which is LEMP.

What is a LEMP stack?

LEMP stands for Linux, Nginx, MySQL and PHP. You may wonder how Nginx manages to represent the E in LEMP.

What does the e in LEMP stand for?

The answer is simply that Nginx is pronounced ‘Engine-X’.

Nginx is an alternative HTTP/HTTPS web server that tends to be lighter weight and historically more performant than Apache. More recently, the performance of the two servers has narrowed but that doesn’t eradicate any potential benefits and drawbacks to each of the software. Depending on the PHP web application and/or framework in use, you may find better throughput from one or the other.

 

“Nginx has become popular due to its event-driven design which can make better use of today’s computer hardware than Apache’s process driven design, The end result is that nginx can serve more concurrent clients with higher throughput than Apache on the same hardware.”

Itworld – Matthew Mombrea (Software Engineer)

Mombrea also stresses that is only true some of the time.

There’s very few people who wouldn’t agree that Nginx is far more efficient at serving static content than Apache. The waters get muddied when serving dynamic content comes into play. This could be PHP, Python or any of the other multitude scripting languages that are used on the back-end to generate web content, but for the purposes of this article we are concentrating on PHP.

If your server is handling a single dynamic site then it is likely that Nginx will offer better throughput and scale better than Apache. Alternatively if you are hosting multiple dynamic sites then the performance difference between the web servers is almost immaterial as PHP itself will likely become the bottleneck to site delivery.

The following quote on Quora, from Sukoon Shete sums things up nicely. “Apache is like Microsoft Word, it has a million options but you only need six,” he says. “Nginx does those six things, and it does five of them 50 times faster than Apache.”

What is the difference between LAMP stack and LEMP stack?

There are several key differences between a LAMP stack and LEMP stack.

 

LAMP Stack LEMP Stack
Uses Apache web server Uses Nginx web server
Process-driven approach Event-driven approach
Slows under heavy load Handles higher load of requests
Creates new thread for each request Handles multiple requests within a single thread
Apache does accept additional configuration Nginx doesn’t accept additional configuration
Better use case for dynamic sites Better use case for static websites
Not as scalable User-friendly scalability
More features and functionality Faster and lightweight

Table 1: adapted from https://www.geeksforgeeks.org/

Should I choose a LAMP stack or LEMP stack?

For new sites/servers, both Apache and Nginx are powerful web servers. Therefore, choosing which to use is dependent on many things. If you are looking for a fast and lightweight server for a single site, you should go for LEMP/NGINX. If you are hosting multiple sites or require specific additional functionality on the web server software, then LAMP/Apache should be your choice.

For existing servers, the likelihood is that optimising PHP and adding the likes of APC or similar opcode cache is likely to speed things up far more than switching web server software and with far less upheaval.

Share

<< Back to resources

Join Our Newsletter

Contact Email  *
First Name 
Last Name 
*Required Fields
I agree to the  Privacy Policy and  Terms of Use 

Here's what other people think

Google Rating
5.0
High standard, professional service. I've worked with Welldata for a number of years and always found their DBA's to be knowledgeable and proactive. Throw any question at them and it will be resolved, it gives real peace of mind knowing you have a partner you can rely on from emergencies to general questions. They also like a challenge and we do throw a few curved balls at them.read more
Paul Miller
Paul Miller
12:34 27 Aug 21
The support I receive from Well Data is extremely responsive. Richard Parsons is my contact and keeps me informed daily on the health of our SQL Databases. Whenever I ask for assistance from Well Data it is quick and professional.read more
Kay Riley
Kay Riley
13:41 19 Aug 21
Really know their stuff and their response times are very good. They provide us with a vital service.
Andy Cole
Andy Cole
13:36 19 Aug 21
The guys at WellData really know their stuff. We wanted a quick route to doing something complex and they sorted it for us very quickly and to a high standard. Very professional, no ego, just excellent and to the point consultancy.read more
Steve Goacher
Steve Goacher
11:31 14 Nov 19
I have worked with the WellData team for many years now and they have always delivered.I would highly recommend them to any business looking for best-value outsourced Expert DBA’s.Being able to offer a rolling contract on the basis that if they don’t deliver you can leave shows their confidence and commitment.Their professionalism and knowledge is second to none.read more
Petro Bartoszyk
Petro Bartoszyk
08:51 18 Oct 19
A very dedicated team of extremely professional and knowledgeable experts
Giulia Iannucci
Giulia Iannucci
14:08 16 Nov 18
We use Welldata for SQL support and are very happy with their service.
David Sadler
David Sadler
09:40 15 Nov 18
Really know their stuff and their response times are very good.
Andy Cole
Andy Cole
11:45 06 Nov 18
Our partnership with WellData has enabled us to resolve critical database problems. Their attitude and service makes them a natural extension to our own technology team, which extends our capability in a critical area of our business.read more
Steve Fenton
Steve Fenton
10:56 05 Nov 18
Having worked with the team at Welldata for approaching 17 years, my company and I have always found them professional, reliable and generally a great firm to work with.read more
John Lynes
John Lynes
14:00 04 Oct 17
WellData provide an excellent level of support and their team are very knowledgeable and always go the extra mile. I would wholeheartedly recommend them.read more
Stefan Parrott
Stefan Parrott
13:12 19 Sep 17