Difference between web servers: Apache, LiteSpeed and Nginx

Member

When you are going to launch a new website, you will muce face with choosing a hosting company. The basic criteria in choosing a hosting are as the following:
- Company reputation
- Server setup
- Technical support
- Reviews
- Features

In this post, we will not mention to the reputation or technical support but we will talk exclusively setup servers, specifically about web server most commonly used by hosting companies.

Apache
Apache is the most popular web server and most inexpensive shared hosting offers are on Apache.

It's not the most popular because it's the best but it's the oldest, is free (open source) and is installed by default with cPanel.

Apache problem occurs in high traffic, not very scalable, increasingly consume more resources and reach to block the whole server.

That's why when your site is getting more traffic, you will receive message from the hosting provider tell you that you stop your current hosting and upgrade to a VPS.

The problem is the construction of Apache, of how manages connections (process-based). Apache creates a new process/thread for each connection. And each process consumes memory and CPU So if you are more the performance is affected.

One solution would be a reverse proxy in front of Apache (nginx or varnish) to serve static elements (images, css, js, html) and Apache to reach only requests in php. It thus consume fewer resources and server can support more traffic.

Very few hosting companies do this because:
- Increases the complexity of the setup
- If it goes well everyone has the smallest hosting package and not upgrade

LiteSpeed
LiteSpeed â€‹â€‹webserver is probably best for your shared hosting. It is 50% faster than Apache PHP script processing and serves up to 600% faster static elements. Consume fewer resources than Apache, can support more traffic, DDOS protection is integrated and can do absolutely everything that makes Apache but better.

From my point of view, the best solution for your shared hosting is a stack with CloudLinux operating system instead of CentOS and LiteSpeed â€‹â€‹webserver instead of Apache.

CloudLinux completely isolated so customers will not get any site to consume too many resources and block and LiteSpeed â€‹â€‹server provides better performance and scalability.

LiteSpeed â€‹â€‹unlike Apache, but not process-based event-driven ie connections serving fewer processes, saving resources. It's a more efficient way to manage connections and that means you can handle more traffic with fewer resources.

This setup has a single problem, not free as CentOS + Apache. CloudLinux cost money, and he LiteSpeed â€‹â€‹cost money and give a high price for hosting packages.

But the advantages are clear: you have stability, performance and scalability.

Nginx
Nginx can be used as a standalone webserver, not just as a reverse proxy in front of Apache. I do not know how to do many things like Apache but those that you know them 50 times faster.

Nginx does not have an integrated PHP mode so you need to communicate with a separate server PHP-FPM namely PHP5.

PHP5-FPM support "adaptive process swamping" which means low traffic site will move super fast and in case of a massive traffic will slow without lock.

Nginx is very scalable (event-driven) can support thousands of concurrent connections (this is and the purpose for which it was invented) and resource consumption is very small (and very predictable).

Setup Nginx/PHP5-FPM can not be used on a shared hosting but it is by far the best solution for a VPS with little memory.

Setup Sites Nginx using sites with very high traffic: Facebook, Instagram, Netflix, WordPress , Intel, CNN and other big websites.

Nginx problem is that it's not compatible with .htaccess and that there is little control panels compatible with it.

From my point of view these are not big problems, you can write rewrite sites that do the same thing you do htaccess rules and the control panel may be waived as long as your goal is performance not play through cPanel.

These are the most popular Web server used by hosting companies so if you want to choose a hosting solutions for your site are:
Cheap shared hosting solution if you want is a company that has a standard setup with Apache CentOS +
If you want stability and performance without paying a lot of money on a VPS when the recommendation is using LiteSpeed â€‹â€‹+ company CloudLinux
if you want a VPS with ultra-performance Nginx is the best option

Above just my points, all depend on you. what servers do you want to have for your web hosting?

Well-known member

The main concern with Apache is that most hosting providers that utilize it don't take the time to learn how to tune it in such a way that it will handle a large amount of traffic. When tuned correctly and behind a reverse proxy like Nginx, your Apache based server will be capable of handeling just as much, if not more traffic than software like LiteSpeed.

One thing that makes Apache such a popular operating system is the fact that it is open source. A vast majority of the websites that you view on the internet are served by Apache servers, and a large number of people participate in development of the Apache project. Apache is an extremely powerful piece of software, but I do agree with you, out of the box it can be very sluggish.

This all boils down to the knowledge/experience factor. If you don't know exactly what you are doing, you're probably going to run into issues. I've been utilizing Apache now for more than 11 years, right now all of our servers at Elixant Technology utilize a heavily modified and tuned version of Apache with a Nginx reverse proxy, and I am proud to say that our servers are capable of serving content faster than a lot of other providers.

New member

Very useful post for both web hosts and those who are looking for hosts, thank you! My sites run on LiteSpeed+CloudLinux but I've seen comments out there that LiteSpeed is not worth its price. But I'm no techy, so I guess this would be a good choice for me. Thanks again for the share!

Well-known member

What a lot of people don't realize is that CloudLinux and BetterLinux were developed not specifically for performance, but for server density. The biggest selling point about utilizing technologies such as these two operating systems and LiteSpeed is the main fact that hosts can be more profitable in the means that they can fit more customers on to one piece of hardware.

I still vouch for Apache with Nginx Reverse Proxy, as we have seen excellent performance and reliability out of this.

Well-known member

I would like to share LiteSpeed and Nginx suffers from security holes these are also not flexible and stable as apache integration ie plugins problem with litespeed and required programming skills whereas you can have everything with apache within minutes. Also Litespeed have restrictive EULA you are bound what content you can share with server high cost is another factor by optimizing apache you can have better speed than LiteSpeed or Nginx so in my eyes apache is winner.

Well-known member

Most people will say that Apache is slow compared to Nginx and LiteSpeed, which is a very modified truth. Apache is not a bad webserver by any means - and properly configured, it'll be very fast. Then again, the same goes for other servers, such as Lighttpd.
Some take shortcuts with extreme caching (with that being an extreme long TTL on cache), whilst some actually properly spend time into configuration. There's no doubt however that Nginx and LiteSpeed are both great webservers, and they usually outperform Apache.

About Us

ForumWeb.Hosting is a web hosting forum where you’ll find in-depth discussions and resources to help you find the best hosting providers for your websites or how to manage your hosting whether you are new or experienced. You’ll find it all here. With topics ranging from web hosting, internet marketing, search engine optimization, social networking, make money online, affiliate marketing as well as hands-on technical support for web design, programming and more. We are a growing community of like-minded people that is keen to help and support each other with ambitions and online endeavors. Learn and grow, make friends and contacts for life.