The web-server fight of the century continues through the pandemic into 2022.
- Who’s faster?
- Is speed all that matters?
- What are the experts choosing?
Find out as they go head-to-head in another of my lazy ass write-ups. Just a couple photos, biased opinions, and hasty conclusions from my 30-minute testing of these two server giants.
Who are NGINX and LiteSpeed?
The biggest and most popular high performance web servers in use today.
If you seriously haven’t heard of them, you’re probably living under a rock and should get an internet subscription.
Not even kidding, these 2 names are mentioned everywhere today. Back in the days…it was only Apache and NGINX…and not much of a battle (speedwise) because NGINX was way newer and built specifically for speed. But Apache hung on because it could do a dozen things NGINX couldn’t.
LiteSpeed (2003) actually released a year before NGINX (2004) and was fast like NGINX but could also do all the things Apache did. You’d think LiteSpeed would be mega-popular but it wasn’t because you had to pay for it…whereas Apache and NGINX were free and open-source. After some years, LiteSpeed decided to release a free open-source version called OpenLiteSpeed (2013).
Which takes us to today’s webhosting landscape:
- Many traditional hosts still offering Apache.
- Newer modern hosts offering NGINX.
- Boutique hosts (both traditional & modern) offering LiteSpeed.
- Ultra-modern trendy hosts offering NGINX & OpenLiteSpeed (OLS).
NGINX vs OpenLiteSpeed (OLS)
So now we realize where the battle is really at. It’s free open-source OpenLiteSpeed taking on the powerhouse free open-source NGINX.
Questions the noobs asks:
- Is OLS really faster than NGINX? – that’s what my post will answer.
- Is OLS newer/cooler than NGINX? – yes, it is.
- Is OLS easier to use than NGINX? – yes, it is. In terms of htaccess compatibility and graphical UI configuration console.
- Main advantage OLS has over NGINX? – OLS allows you to use LiteSpeed Cache plugin (which is my favorite cache plugin for WordPress).
Questions the pros ask:
- Is OLS really faster than NGINX? – diehard NGINX devs/admins say no. Diehard LS devs/admins say yes.
- Is OLS newer/cooler than NGINX? – some pros think it’s gimmicky and not as proven, not as stable.
- Is OLS easier to use than NGINX? – not if they prefer NGINX config.
- Advantages NGINX has over OLS? – admins today are more familiar with NGINX config, and find it less hassle to config/manage.
- Advantages OLS has over NGINX? – easy learning curve for pros, easy interface for non-pros, htaccess compatible, also the super powerful native WordPress cache plugin (LiteSpeed Cache) whereas NGINX doesn’t have one.
NGINX vs OLS speed benchmark charts
Some notes about my testing:
- I fired up a bunch of cheap $5 VPS (1-core, 1gb ram). One with NGINX, another with OLS. (Using mostly default configs, I didn’t fine-tune them.)
- NGINX server had fresh WP site with only Cache Enabler plugin.
- OLS server had fresh WP site with only LiteSpeed Cache plugin.
- Then used free loader.io account to throw 10,000 clients/min at HTTPS domain using GET method.
NGINX (un-cached) vs OLS (un-cached)
What this means:
- NGINX served 150 requests and averaged 1-sec for each, before failing in 6 seconds.
- OLS served 383 requests but averaged 9-sec for each, before failing in 16 seconds.
- Raw OLS is simpler weaker to me. I much prefer raw NGINX handling fewer requests at reasonable response (1sec) before crashing early, than OLS with slower initial response before trying to unsuccessfully handle more concurrent hits.
- But realistically, this comparison doesn’t matter. Because nobody in their right mind would be serving 10k requests/min without caching.
NGINX (cached) vs OLS (cached)
What this means:
- Don’t bother looking at average response times. Both servers run virtually at the same speed once the cache kicks in after 2 seconds (~66ms per request). The average is mostly affected by the slow initial response being averaged out.
- But indeed, OLS is faster by a tiny tiny margin. Initial slow response was quicker (OLS 106ms vs NGINX 137ms) and then the stable response was a tiny bit faster (OLS 65ms vs NGINX 67ms).
So is OpenLiteSpeed truly faster/better than NGINX?
Is OpenLiteSpeed faster than NGINX?
- Without caching, I’d say NO.
- But with caching, I’d say YES but only by a freaken hair. Difference so small you wouldn’t even notice.
Any other benchmarks showing LiteSpeed being 20-300% faster than NGINX are silly to me. I’m a diehard LiteSpeed fan myself but don’t believe it’s that much faster. OpenLiteSpeed (free version) is like 1-2% faster at most. LiteSpeed Enterprise (paid version) is maybe 3-5% faster at most. If even that. And sometimes, I swear NGINX is faster.
LiteSpeed can do many things that produce faster end result in real-world use. Caching dynamic requests, security features (that decrease resource drain from DDOS attacks), and more.
What’s the real benefit of LiteSpeed/OpenLiteSpeed over NGINX?
The #1 reason for me is the free LiteSpeed Cache plugin (compatible with only LS/OLS servers). It’s a freaken amazing plugin with dozens of performance features to speed up your site in so many ways. This plugin alone is what separates LS/OLS from NGINX. NGINX doesn’t have any native cache plugin for WordPress. Sure, you can use other cache plugins on NGINX but they aren’t as powerful as the LiteSpeed Cache plugin.
Of course, NGINX diehards will argue that NGINX can do this too. They’ll claim “NGINX also has micro-caching capabilities to rival LiteSpeed’s ESI dynamic cache”. Which is yeah, it’s true, but it’s not as easy to configure for the everyday person. With LiteSpeed cache plugin, you just make a few clicks. With NGINX, you gotta learn how to make NGINX configs and manually write out exactly what you need. Yeah…no thanks. Just not realistic unless you’re an NGINX expert managing only a few sites.
Let’s not forget about LiteSpeed’s QUIC.cloud service (which easily integrates with LiteSpeed Cache plugin) and caches your site at the edge…rivaling cloud-cache services like NitroPack for a fraction of the price. NGINX doesn’t have anything like that.
How urgently should you switch to OpenLiteSpeed?
Well, the majority of high-performance web servers out there are still happily running on NGINX. It works well, it’s proven, can still be cached, and many admins are familiar with it. You’ll still get great performance out of it.
But if you’re curious to try something new…OpenLiteSpeed is worth looking at. For that reason, you may have noticed many new hosts adopting it.
- If you’re happily on NGINX, don’t sweat it.
- If you’re shopping for a new server, LiteSpeed/OpenLiteSpeed are worth a look.
- If your name is WPJohnny, you’ve only used LiteSpeed for the past 10+ years. 😉