Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


OpenLiteSpeed vs Nginx for static caching?
New on LowEndTalk? Please Register and read our Community Rules.

OpenLiteSpeed vs Nginx for static caching?

MannDudeMannDude Member, Host Rep

It's been years since I've used LiteSpeed, and since then, OpenLiteSpeed has been released. Most my experience with web servers and caching is from Nginx, with some light Varnish experience as well.

What has your experience been with OpenLiteSpeed? Comparable, better, worse?

This is literally for only static files. Caching for JS, CSS, and images (png/svg).

Working on a little personal use CDN and figured I'd get some feedback on OpenLiteSpeed before diving straight into what I'm already familiar with.

For static file caching, do you prefer Nginx or OpenLiteSpeed?
  1. For static file caching, do you prefer Nginx or OpenLiteSpeed?131 votes
    1. Nginx
      64.12%
    2. OpenLiteSpeed
      25.95%
    3. Other (See comment)
        9.92%
«1

Comments

  • niyyieniyyie Member, Host Rep

    No experience with OpenLiteSpeed.

    What language are you using for the custom CDN?

  • wpyogawpyoga Member

    OpenLiteSpeed has benchmarked their own server against Nginx and Apache. Of course they win. https://openlitespeed.org/benchmarks/small-static-file/

    Which web server to use, depends on your personal values. Because most of your experience is with Nginx, I'd say:

    • if you want to learn, choose OpenLiteSpeed -- you will learn a lot
    • if this CDN is important to you, and you need it to be reliable, choose Nginx -- you know it well enough

    As for me, I only have some Apache and Nginx experience, so if you decide to go with OpenLiteSpeed, do let us know :)

    Thanked by 1webcraft
  • vovlervovler Member

    Do your own tests and do not rely on openlitespeed saying its better than nginx.

    I believe Vultr provides 10Gbps VPS.
    Get 3 VPSs, 1 for OLS, 1 for Nginx, 1 for making the requests. The first 2 of them only with 1 core so you can clearly see the differences. Double check to see if both have the same CPU and start testing the CPU and RAM usage :)

  • RAM I/O vs DISK I/O :#

  • zxrlhazxrlha Member

    :( No experience, my site has little people visiting so frontend performance is unimportant.

  • Not really experienced, but I have tested similar configurations.

    In my tests (~5m ago), it seems like LiteSpeed was better for WordPress, by a significant margin, specially when using Litespeed Cache.

    I only use it for WP websites, tho. Anything else I'd use Nginx or Caddy.

  • Tim_kwakmanTim_kwakman Member
    edited May 2021

    I've been running OpenLiteSpeed (OLS) on a few servers over the past year or so;

    • A webserver that is used for sites that are pretty busy (at least 100 requests/s) (not using their caching here)
    • A VPS that I manage that has a few hundred sites on there (using their caching for Wordpress sites mainly).
    • Two other VM's used as backends

    Their cache works great, Wordpress sites are very fast, and that's why I'm running it there. But it is a pain to debug sometimes. They do have "debug mode" but I think Nginx is a lot easier to debug. OLS also fees a little "unstable" at times, and some time ago (few months) they compiled their lsphp with a wrong version of OpenSSL I believe, on Debian, causing all cURL requests from PHP to fail due to SSL errors - They fixed this after a week or so when someone reported it at their forum.

    When debugging Nginx, their error log says pretty much exactly what went wrong, but from what I've seen, it is a lot harder to find the issue when using OLS.

    Anyhow, OLS is great software, and it makes Wordpress sites fly. I personally use Nginx + Varnish for my own applications, because Varnish is amazing (especially with the xkey module), and Nginx is just stable and it's easy to find out what's wrong (e.g. post body too big - You'll see it in your nginx error log).

    For your use-case: Caching static files, I'd go with Varnish, I used both Varnish and OLS, and I went with Varnish for caching on my assets CDN due to how stable varnish + nginx is. If you just require simple caching I think Nginx can even do it on it's own, but if you want more extensive control, then, in my opinion, Varnish is the way to go. If you want to have something that works out of the box with Wordpress, then OLS is something to look into, I think Wordpress is their focus (when I look at their advertisements).

    -- Some extra context for the OLS feeling "unstable" comment --
    Things like, when you have OLS running for some time (21 days in this case), it will show that your listeners & vHosts are no longer linked at their panel (they still work) - Happens on at least 3 of my OLS servers, one uses Debian, another uses CentOS, so it's not an isolated incident. After a restart, the dashboard is fine again. It's not breaking or anything, but it does, combined with their lsphp issue, feel like something that I would prefer not to run in production.

    -Tim

  • isunbejoisunbejo Member
    edited May 2021

    OLS caches files on ram (dev shm)

    nginx static files on disc :D

    Try nginx static files on ramdisc or for dynamic php with
    fastcgi_cache path ​mount to ramdisc (tmpfs)

    Sites nginx + fpm can fly with 1300 req/s on my server production 16 core netcup
    And 250req/s on vps 2 core netcup

  • tetechtetech Member

    Varnish

  • nfnnfn Member

    Nginx cache to ram is amazing fast...

  • I have used NGINX and OpenLiteSpeed both and I must say NGINX works faster for single high traffic websites but also noticed that you need to do some tweaks to enable htacess rules and https protocol but on the other side, OPLS works fine without any additional tweaks it does work better for WordPress websites for sure.

    Thanked by 1desperand
  • BinaryBinary Member, Host Rep
    edited May 2021

    We've tried OLS for some time, and did run into quite a lot of caching issues.
    If you're more familiar with NGINX, you should stick to it, especially since NGINX can be quite extensive / useful in terms of customizability.

    You can also try Cloudflare Workers to serve static pages - works amazingly well.

    Thanked by 1desperand
  • I was faced tons of issues with the ols. Most of them about weird and wrong caching behavior for dynamic content. Hard to trace, hard to debug issues, Weird logs formatting. With nginx everything more predicted and easy to understand and administrate. But ols webadmin I like a lot.

  • OLS is good for Wordpress sites; otherwise, I would go for Nginx. This is true whether you looking to use them as web servers or reverse proxies.

  • OPLS covers almost everything that available in LiteSpeed Enterprise except GUI and WordPress websites works faster on LiteSpeed and easy to define Apache rules in .htaccess in the other hand Nginx is good for high traffic websites every load faster but when it comes to configuration etc then you might find it bit difficult.

  • LTnigerLTniger Member

    Varnish is more superior than Litespeed or Nginx. Consider such software as Apache Traffic Server.

  • @LTniger said:
    Varnish is more superior than Litespeed or Nginx. Consider such software as Apache Traffic Server.

    Varnish caches om RAM vs nginx caches on HARD DRIVE :D

    10 : 1 :#

    Thanked by 1JasonM
  • LTnigerLTniger Member

    @isunbejo said:

    @LTniger said:
    Varnish is more superior than Litespeed or Nginx. Consider such software as Apache Traffic Server.

    Varnish caches om RAM vs nginx caches on HARD DRIVE :D

    10 : 1 :#

    When you are using NVMe, the difference is not so radical.

    Thanked by 1tjn
  • @LTniger said:

    @isunbejo said:

    @LTniger said:
    Varnish is more superior than Litespeed or Nginx. Consider such software as Apache Traffic Server.

    Varnish caches om RAM vs nginx caches on HARD DRIVE :D

    10 : 1 :#

    When you are using NVMe, the difference is not so radical.

    Yeah..its all about I/O speed

    OLS,VARNISH default caches on RAM
    NGINX default caches on DRIVE

    whatever webserver. RAM is more superior 😎

  • Mahfuz_SS_EHLMahfuz_SS_EHL Member, Host Rep

    @vovler said:
    Do your own tests and do not rely on openlitespeed saying its better than nginx.

    I believe Vultr provides 10Gbps VPS.
    Get 3 VPSs, 1 for OLS, 1 for Nginx, 1 for making the requests. The first 2 of them only with 1 core so you can clearly see the differences. Double check to see if both have the same CPU and start testing the CPU and RAM usage :)

    I did this. OLS could serve much more requests than nginx.

  • It so much depends on the application you use it for also. If you’re able to use a CMS that supports (open)LiteSpeed caching plugins like WP, Magento, Presta, opencart, phpBB, Craft, Laravel, etc, it would outperform nginx and apache by miles. If you have a different setup or if the caching functions are unsupported/not working/behaving as it should from LS, a custom haproxy+varnish+whatever webserver with php-fpm would win, not even with a close stretch.

  • JasonMJasonM Member

    Openlitespeed/litespeed is best of dynamic file caching like php.
    for static files like css/js/gif, I would prefer nginx. its more lite-weight.

  • @JasonM said:
    Openlitespeed/litespeed is best of dynamic file caching like php.
    for static files like css/js/gif, I would prefer nginx. its more lite-weight.

    LiteSpeed cache can also really deal well with static files.. nginx does NOT outperform LS if you configure it correctly

    Thanked by 1JasonM
  • JasonMJasonM Member

    @FoxelVox said: LiteSpeed cache can also really deal well with static files.. nginx does NOT outperform LS if you configure it correctly

    okies, will try LS cache for static files.

    Thanked by 1FoxelVox
  • MannDudeMannDude Member, Host Rep

    I'll probably just stick to nginx, then. Old familiar.

  • quagsquags Member

    Openlitespeed is great when it works. I use it on directadmin systems, and it generally performs well. But there is a big catch - you may get random unexplained issues. It doesn't seem to handle tons of domains well, I have seen it randomly break with out any real reason and it isn't the easiest set up to debug.

    IMO for a a few wordpress site, OLS is good. If you are scaling to a lot of domains the enterprise features that are missing start to show. I also use litespeed enterprise, which has not had any of these strange issues. Consider though what open litespeed is - a test bed for enterprise, and the hope that you upgrade to enterprise at some point.

  • I tried Nginx and rather quickly stopped using it, because I kept forgetting how to write rewrite rules - was doing that too rarely.

    But OpenLiteSpeed works great on a small low-end VPSes.
    Also supports .htaccess syntax, which was one of the major reasons for me to stick to it.

  • MarcoooMarcooo Member, Host Rep
    edited May 2021

    We have Just a Apache server with 4gb ram 4 cores handles easly 10k req/sec i think its really depends on the site and finetuning of the webserver. Used openlitespeed but in reality it was slower than nginx of Apache with a few changes.

  • nfnnfn Member

    nginx cache sould be mounted in a tmpfs for better performance.
    OLS is hard to debug.

  • 23ontime23ontime Member
    edited September 2021

    Sorry but this thread is kinda stupid because Nginx is designed like a reverse proxy if you are doing CDN loading or Load balancing and Litespeed is just for like cPanel / shared hosting so you cannot really compare about static file delivery.

    The only advanced to Litespeed is that it can handle overloaded cPanel shared servers better than Nginx but if you want a high traffic single site or load balancing / proxy Nginx is king.

    Anything you want to customize like HTTP Headers or debugging things is more flexible on Nginx and more secure on Nginx. The only disadvantage to Nginx really is that some people think their syntax/code formatting is a bit inefficient sometimes like you must writing the directives 2x or 3x on your server block.

    • By default Litespeed using Unix socks which is horrible and crashes
    • you will need know how to change Litespeed to TCP
    • you will need to be aware of LS htaccess problems (very sensitive and can be hacked)

    99% of cases for speed/security/SEO/simplicity should use Nginx and FastCGI Cache and the only case to use Litespeed is for cheapass cPanel hosting companies.....

    Nginx + FastCGI Cache + TCP (PHP-FPM) + TMPFS (RAM disk) is insanely reliable.

    ......and do not believe anything that Litespeed claims, they are well known to post fake benchmarks around the internet.

    Maybe their software is decent, but all their dishonest shilling was a horrible decision....

    P.S. guys Varnish is dying and causes a lot of conflicts/stuck-cache esp. if you are using a dynamic application like WordPress.... stop recommending it

    @DataRecovery said: Also supports .htaccess syntax, which was one of the major reasons for me to stick to it.

    .htaccess is actually one of the biggest reasons for NOT using Litespeed/Apache because it means if your site has any vulnerable thing like insecure WordPress plugin or PHP script it can easily hack the rules of your .htaccess file and take over your entire website with malware or 301 your entire website to some Japanese viagra spam or whatever and kill your domain reputation (Nginx can not)

    https://wordpress.org/support/topic/litespeed-vs-nginx-vs-apache-htaccess-malware/

    https://nystudio107.com/blog/stop-using-htaccess-files-no-really

Sign In or Register to comment.