Howdy, Stranger!

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


Caddy vs Nginx RAM and CPU foodprint
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Caddy vs Nginx RAM and CPU foodprint

I wonder if Caddy is much more RAM and CPU intensive than Nginx?
And how about performance comparison of both?

Comments

  • jgillichjgillich Member
    edited April 2017

    Caddy uses quite a bit more RAM, and nginx handles more concurrent requests: https://community.centminmod.com/threads/caddy-http-2-server-benchmarks.5170/#post-34367

    If you're dealing with very high traffic, nginx is the best choice. For anything else, I think Caddy has the better feature set while also being easier to configure.

    Thanked by 1eva2000
  • frkfrk Member

    The only thing I'm missing in caddy is decent support for openVZ. Running it as a systemd service under an old kernel version (like openvz uses) is a real pain in the ass.

  • eva2000eva2000 Veteran
    edited April 2017

    jgillich said: Caddy uses quite a bit more RAM, and nginx handles more concurrent requests: https://community.centminmod.com/threads/caddy-http-2-server-benchmarks.5170/#post-34367

    Yup when i did those linked benchmarks Caddy used 3x time more cpu resources + 2.5x times more memory than Centmin Mod Nginx for HTTP/2 HTTPS based h2load load tests for only ~33% the performance of Centmin Mod Nginx.

    1 thread h2load stress test with higher loads at 1,000 concurrent users and 50,0000 requests

    • For Centmin Mod Nginx 1.11.3 HTTP/2 port 443 = 11,322.50 req/s average
    • For Caddy 0.9 HTTP/2 port 448 = 3,751.71 req/s average

    • CentminMod.com Nginx 1.11.3 HTTP/2 h2load stress test cpu load peaked at 0.60 and 548MB total memory used

    • Caddy 0.9 HTTP/2 h2load stress test cpu load peaked at 1.57 and 1289MB total memory used

    2 thread h2load stress test with higher loads at 1,000 concurrent users and 50,0000 requests

    • For Centmin Mod Nginx 1.11.3 HTTP/2 port 443 = 10,850.84 req/s average
    • For Caddy 0.9 HTTP/2 port 448 = 3,942.75 req/s average

    • CentminMod.com Nginx 1.11.3 HTTP/2 h2load stress test cpu load peaked at 0.62 and 551MB total memory used

    • Caddy 0.9 HTTP/2 h2load stress test cpu load peaked at 1.86 and 1393MB total memory used
  • @eva2000 said:
    Yup when i did those linked benchmarks Caddy used 3x time more cpu resources + 2.5x times more memory than Centmin Mod Nginx for HTTP/2 HTTPS based h2load load tests for only ~33% the performance of Centmin Mod Nginx.

    >

    I'm wondering if they've made any changes to increase performance recently.

  • ckissi said: I'm wondering if they've made any changes to increase performance recently.

    Not according to the changelog. But for 99% of sites, Caddy is fine, I really wouldn't worry too much, it's still pretty darn fast.

  • raindog308raindog308 Administrator, Veteran

    If you're looking for low-mem, lighttpd is an alternative. I haven't run it hard, but it is easy to setup for static hosting and fine for Wordpress, etc.

    From the greatest post in the entire history of the Internet and all time before it:

    https://lowendbox.com/blog/yes-you-can-run-18-static-sites-on-a-64mb-link-1-vps/

    Thanked by 1yomero
  • eva2000eva2000 Veteran
    edited April 2017

    ckissi said: I'm wondering if they've made any changes to increase performance recently.

    Last time i asked Matt (Caddy), he said focus is on features and getting that right and not performance yet. He's welcome to user contributions to Caddy code for performance but I am not a Go programmer. So if you are a Go programmer that might be something you should look at for contributing to Caddy :)

    So priority is features over performance for Caddy right now. So pick the right tool (web server) for the job (your needs) :) As mentioned for low traffic sites Caddy should be fine - just keep in mind as traffic grows with Caddy you'd probably end up needing more cpu and memory resources than you would with Nginx right now in Caddy development cycle. System resource monitoring is important ;)

    For my Centmin Mod LEMP development, I am always evaluating and benchmarking web server performance for my own needs to see what I can integrate into Centmin Mod that adds value. So I evaluated Caddy as well as H2O - both HTTP/2 based web servers which suffer similar performance regressions (ie. increasing performance regressions as you add more HTTP headers to pages served over HTTPS) compared to more established Nginx web server.

    Also had a brief look at Hiawatha as one of my users mentioned it in relation to slowhttptest tests comparison Nginx vs OpenLiteSpeed vs Apache vs Lighttpd and fact that Nginx (Centmin Mod Nginx) can be tuned to match or out perform Hiawatha for slowhttptest tests anyway.

    It's reason why currently Centmin Mod only plans to add OpenLiteSpeed/LiteSpeed integration with Nginx web server eventually so Centmin Mod sites can be served from either Nginx and/or OpenLiteSpeed/LiteSpeed web server as they are both best performing at scale (think 500,000+ unique ip visitors/day type loads).

    Some earlier OpenLiteSpeed vs H2O vs Centmin Mod Nginx page speed tests https://community.centminmod.com/threads/http-2-h2o-vs-openlitespeed-vs-nginx-spdy-3-1.2564/

    Though all these comparisons are bias to Nginx as it has a much longer mature stable history of development as an advantage over these newer web servers for traditional web server type loads/usage.

    Though the future we will see more of just Nginx vs OpenLiteSpeed/LiteSpeed type of questions as they're the only 2 web servers I can see for folks running at 'Scale' with efficient server resource usage in mind :)

  • WSSWSS Member

    @raindog308 said:
    If you're looking for low-mem, lighttpd is an alternative. I haven't run it hard, but it is easy to setup for static hosting and fine for Wordpress, etc.

    thttpd, athough older than dirt, still works perfectly well, and CGI passthrough isn't very difficult, either.. but low end tends to be a slightly different group of needs than the aforementioned..

  • @jgillich said:

    ckissi said: I'm wondering if they've made any changes to increase performance recently.

    Not according to the changelog. But for 99% of sites, Caddy is fine, I really wouldn't worry too much, it's still pretty darn fast.

    I'm worrying a bit because it's low-end VPS with 512MB only, I like caddy's simplicity a lot but really don't know if it can run on such a low-end box.

  • ckissi said: I'm worrying a bit because it's low-end VPS with 512MB only, I like caddy's simplicity a lot but really don't know if it can run on such a low-end box.

    only way to know is try it and learn from the experience :)

    worse case you'd need to switch web servers or upgrade server :)

  • jgillichjgillich Member
    edited April 2017

    ckissi said: I'm worrying a bit because it's low-end VPS with 512MB only, I like caddy's simplicity a lot but really don't know if it can run on such a low-end box.

    I've used Caddy in a 256MB container as a proxy for a couple low traffic sites, worked fine. The only way to find out what's best here is to try it. Mount a swap file to be safe, and if it's ever used, consider nginx.

  • raindog308raindog308 Administrator, Veteran

    But anyway, to get back on topic - where is this CPU that prints food? I'm hungry.

    Thanked by 2yomero mholt
  • YuraYura Member

    @raindog308 said:
    But anyway, to get back on topic - where is this CPU that prints food? I'm hungry.

    Get a slice at the Deli "HungryVM"

    Thanked by 2yomero JahAGR
  • joepie91joepie91 Member, Patron Provider

    @ckissi said:

    @jgillich said:

    ckissi said: I'm wondering if they've made any changes to increase performance recently.

    Not according to the changelog. But for 99% of sites, Caddy is fine, I really wouldn't worry too much, it's still pretty darn fast.

    I'm worrying a bit because it's low-end VPS with 512MB only, I like caddy's simplicity a lot but really don't know if it can run on such a low-end box.

    Yes, you can.

  • @raindog308 said:
    But anyway, to get back on topic - where is this CPU that prints food? I'm hungry.

    My mistake :) , unfortunately, we have to eat food instead of foot now :D

    Thanked by 1raindog308
  • deadbeefdeadbeef Member
    edited April 2017

    @ckissi said:
    I'm worrying a bit because it's low-end VPS with 512MB only, I like caddy's simplicity a lot but really don't know if it can run on such a low-end box.

    I don't know, the whooping 9 MB it's using on my end could really blow your vps's 512 MB...

    Thanked by 1mholt
  • ehabehab Member

    @deadbeef said:

    what you think of rancher and have you used rancheros?

  • @ehab said:

    @deadbeef said:

    what you think of rancher

    It's nice to use but not mature yet.

    and have you used rancheros?

    Yes.

  • @deadbeef said:

    @ckissi said:
    I'm worrying a bit because it's low-end VPS with 512MB only, I like caddy's simplicity a lot but really don't know if it can run on such a low-end box.

    I don't know, the whooping 9 MB it's using on my end could really blow your vps's 512 MB...

    So Caddy is using only 9MB on your VPS? What traffic does it handle?

  • WSSWSS Member

    HTTP, generally.

  • Still prefer for Hiawatha + Httpd 2.4 (aka hiawatha-proxy).

  • @ckissi said:
    So Caddy is using only 9MB on your VPS? What traffic does it handle?

    Very low traffic, it reverse-proxies a few internal sites.

  • Along Caddy, Traefik one to consider. Dynamic service discovery is very nice when using Kubernetes/Nomad etc.

    Homepage tells more https://traefik.io/
    Even some benchmarks against nginx (kinda old versions both) http://docs.traefik.io/benchmarks/

    To OP: define your usage-pattern, memory usage varies. My guess is that you just need proxy with minimal memory footprint when idling, you won't be asking these if serving 1k+/s hits :P

    For quick checks, just run docker-images for each and check memory consumption and even run some ab2/wrk-tests to find you cpu/memory usage.

    Docker-images
    https://hub.docker.com/r/abiosoft/caddy/
    https://hub.docker.com/_/nginx/
    https://hub.docker.com/_/traefik/

    Thanked by 1ehab
Sign In or Register to comment.