I am in the process of setting up a new Magento 2.3 store with Apache, Varnish (probably Turpentine) and Redis. All requests will be via HTTPS (SSL). I recently became aware of the Litespeed Web Server, LiteMage Cache and the company's Magento extension. I wonder if I should switch from Apache to Litespeed?

The advertisements show this combination massively outperforming Apache + Varnish as well as Nginx + Varnish + Turpentine. Here's a quote from an advertisement:

  • It is up to six times faster than Apache
  • It is three times faster than Apache in SSL
  • With its LiteMage cache, LiteSpeed makes Magneto pages to run up to 75 times faster
  • It increases PHP performance by 50%

I'm skeptical. Should I believe any of those claims? I see a lot of ads and promotions from those making money from this combo (hosting companies) but I'm not finding much independent benchmarking. Litespeed's benchmark page is here. They claim:

LiteSpeed Web Server with LiteMage Cache was up to 3 times faster than nginx with Varnish, and 4 times faster than Apache with Varnish.

If LiteSpeed + LiteMage Cache is really that much faster, why aren't more people discussing it here? I find very few questions related to it.

I would rather not get locked into a proprietary solution if I can do as well or nearly as well with the widely used free solutions. Looking for advice. The purpose of this post is to gets the facts from reliable sources who have experience rather than from advertisements promoting a for-profit product. I would spend the money for LiteMage, but only if it is really worth it based on real-world experience from folks here. Thanks.

  • this is just a marketing fake... illusion. speed != cache. – MagenX Dec 16 '19 at 21:44
  • 1
    @MagenX - You seem to have strong opinions. Do you have any evidence to support your statement? If not,then why should I trust you any more than I would trust any random opinion? – MountainX Dec 16 '19 at 22:02
  • just run speed test on any litemage magento 2 shop, and see how it randomly dies... TTFB is about your php code, not litespeed, nginx, apache or varnish. litemage caches good, but not that good to pay for it. in e-commerce business i will rely on auto-scaling, cache is an option that good to have. – MagenX Dec 17 '19 at 15:25

Should I believe any of those claims?

You shouldn't believe any claims unless you can independently verify them.

That said, it's easy to decipher why LiteSpeed could be somewhat faster than other setups.

Let's take the most performant open source stack which consists of NGINX + Varnish.

NGINX terminates TLS and proxies that over to Varnish, which is the caching layer.

In its turn, Varnish proxies request to the backend (if it is not satisfiable from the cache at the moment), over to NGINX again.

So it is an NGINX sandwich of sorts. The potential performance offenders here is proxy buffering in both NGINX and Varnish.

What proxy buffering means, in short, is that before giving output to the client, NGINX #1 (TLS) will wait to collect a small amount of response data from Varnish (which is the backend to NGINX #1).

This is behavior, which is by default (proxy buffering is enabled). It is primarily useful for ensuring that the slow client will not "burn down" backend connections (which are typically RAM-hungry):

Say you have one really slow client, and NGINX proxy buffering is not enabled. It means that a connection is fully "consumed" by the client, while it's slowly receiving data. NGINX must keep the connection to its backend (normally, it's PHP-FPM in other setups), while synchronously delivering data to the client.

With proxy buffering enabled, NGINX can close the connection to the backend (which is good, especially if it required a good amount of RAM, in case of PHP-FPM as backend), as soon as it got the whole response from it, and then NGINX can release the data to the client, while the backend is free to do other stuff.

However, in the NGINX sandwich kind of stack (Magento 2 case), it is arguable whether you need proxy buffering all the way and you may want to tune it (and it would surely produce better results).

Why is because you would then reduce the time it takes for different components of the stack to "talk" to each other. Again, those are:

NGINX #1 (TLS) -> Varnish -> NGINX -> PHP-FPM.

Keeping buffering in NGINX #1 is not very essential because its backend is a lightweight process (Varnish). The same applies to Varnish -> NGINX link. But buffering there is absolutely required because this is how the caching works in Varnish - it has to get the entire response in order to cache it.

So either way, you can decipher from all of this, that having LiteSpeed combine TLS termination feature of the above stack, and not just that, is already a win because it won't cause extra buffering between different software components.

If LiteSpeed + LiteMage Cache is really that much faster

It really isn't that much faster! Those numbers where NGINX+Varnish performs at 3K requests per second are very good, not to even bother considering other solutions.

why aren't more people discussing it here?

Because it's commercial, and you'd rarely if ever, hit the ceiling with the Varnish solution. You need to have an Uber-size traffic Magento 2 instance (literally) to warrant the need for Litespeed, although I would just fine-tune things with proxy buffering as a first step.

Again, these numbers from Litespeed look like they are, and maybe they are times better. But this is more of a marketing thing, e.g.: would you really bother so much if you had a trillion dollars which you can never spend in your entire lifetime but then someone offered you another 2 trillions for doing some extra work? I'd say "meh, I am fine with my trillion, thank you" :)

| improve this answer | |
  • Great answer. Thank you. – MountainX Dec 8 '19 at 23:29
  • 1
    Even if I don't have an uber-sized site, I would like my pages to load as quickly as possible even for 1 visitor. Can LiteMage offer an advantage there? – MountainX Dec 9 '19 at 20:23
  • 1
    @MountainX my main point here is that it won't make any noticeable difference whatsoever. – Danila Vershinin Jun 30 at 19:40

Full disclosure: I work for a hosting company that regularly uses LiteSpeed, but we've worked with a lot of technologies and Magento, including Apache, Nginx, Varnish and so forth.

In our experience, nothing beats the speed of LiteMage (the caching system within LiteSpeed for Magento). We regularly migrate clients from other platforms with Time To First Byte (TTFB) speeds of ~0.5-4.5s and can reduce that to ~20-100ms using LiteSpeed's solution. They are also very fast to implement newer technologies as well, with QUIC already fully integrated within the LiteSpeed web server.

In my view, one of its major advantages other than speed is that it's very simple to implement, which reduces the complexity of the stack on the server-side. With Nginx/Varnish there are a lot of server-side components to configure maintain, whereas with LSWS + LiteMage, there's just one that 'just works'. As Danila mentioned, there's also a reduction in the communication time between layers as a result.

As you might already know, the associated LiteMage module that is installed within Magento handles automatic cache invalidation based on the Magento tag system.

For those running larger stores that require load balanced servers, there's also the LiteSpeed WebADC load balancing platform that incorporates LiteMage caching. With this, the cache is kept within the load balancing layer and is therefore centralised.

Of course, as a commercial product there's a cost involved, so in my opinion whether or not this is worth paying for will depend on how much you're selling via the store, and also the time that you have for configuration/maintenance of other solutions.

Hope that helps!

| improve this answer | |
  • Thank you for sharing your perspective. It helps. – MountainX Dec 9 '19 at 20:21

I wouldn't believe any "benchmarks" released by Litespeed Technologies, they were apparently caught posting on Reddit and elsewhere anonymous benchmark websites showing their software was "faster" than Nginx LEMP stacks (without any details, of course) while hiding their ownership of said websites:


You'll also notice how quickly any online questions about Litespeed are immediately answered by their own employees and marketing partners (e.g. cPanel shared hosting companies).

Nobody in the DevOps world is using or recommending their Apache copycat server for high-traffic websites, just look at the Alexa Top 1000 websites to verify this.

Their LS Cache (LiteMage) is very similar with Varnish output caching, which results in many conflicts esp. on shared hosting environments that are locked down and have PHP-based CMS software, because there are so many different caching layers and frontend settings that users and websites might modify. In fact, many of the speed results they advertise are more due to the aggressive (bloated) minify/async settings that are activated in their CMS plugins for Magento and WordPress, and not directly related to server-level caching.

Note: output caches are problematic for many reasons, and Varnish in particular has been rapidly losing market share esp. after HTTPS started taking over big time.

Magento is rather heavy and very dynamic, so keeping your website on a dedicated VPS (VM) server and using a simple LEMP stack that scales smoothly is extremely effective, i.e.:

  • Ubuntu LTS
  • Nginx (web server, no Apache needed)
  • FastCGI Cache (Nginx)
  • MySQL or MariaDB
  • Redis (and/or Memcached) for object caching if possible
  • no CMS cache plugins needed

Frankly, most of the people I've seen "recommending" Litespeed don't know much about Nginx to begin with, or work exclusively with Apache-based shared hosting companies and services (such as some of the answers on this page that believe Varnish + Nginx is still popular... it really hasn't been for years now).

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.