Caddy vs nginx benchmark

This might make for an interesting read:

https://blog.tjll.net/reverse-proxy-hot-dog-eating-contest-caddy-vs-nginx/

I lean towards using Caddy these days because of its many conveniences and an overall better configuration out of the box, and in my experience the quality of Caddy has massively increased in v2. However, nginx remains a solid performer, especially when tuned correctly and because of the lack of GC cycles.

Thanked by (3)saibal lorian Wolveix

Comments

  • I think nobody beats nginx. That's like the GOD of web servers... Nginx reverse proxy + Apache, such a banger. Nginx standalone even better.

  • I don't see a reason to use caddy after learning how to configure nginx. I get that caddy has intuitive configs, but that's not so helpful if I have to learn them instead.

    Having the server actually reload when certificates change is nice. I think the cluster awareness sounds useful too. Though, I have a nginx cluster running and it works great too (even though the servers have no idea that they're in a cluster).

    Thanked by (1)MannDude
  • @Hxxx said:
    Nginx reverse proxy + Apache, such a banger. Nginx standalone even better.

    Caddy reverse proxy + nginx website server, such as hipster.

    @mwt said:
    I get that caddy has intuitive configs, but that's not so helpful if I have to learn them instead.

    Caddyfile is cleaner than nginx config.

    1 of 1 my VirMach VPS is live in Miami, but you should go with Webhosting24 or LevelOne. (paid links)

  • @yoursunny said:

    @mwt said:
    I get that caddy has intuitive configs, but that's not so helpful if I have to learn them instead.

    Caddyfile is cleaner than nginx config.

    Fair. I think my nginx configs are complicated because they do a lot of things though. I'd have to translate that to caddy. It might be cleaner, but if I'm making it do a lot of stuff, it probably won't be that much cleaner.

    I'll probably try caddy at some point, but I really like nginx and feel like it's become intuitive to me (even though it originally was not).

  • @mwt said:
    I don't see a reason to use caddy after learning how to configure nginx

    Better default configuration.
    The article shows there are pitfalls that you must be aware of when configuring nginx, this isn’t really the case with Caddy.

    Thanked by (1)yoursunny
  • @stevewatson301 said:

    @mwt said:
    I don't see a reason to use caddy after learning how to configure nginx

    Better default configuration.
    The article shows there are pitfalls that you must be aware of when configuring nginx, this isn’t really the case with Caddy.

    I wouldn't say that caddy's defaults are "better". Allowing your webserver to use all of your system resources by default isn't an objectively good thing. Most of the time, you expect other software on your system to need more resources than caddy/nginx.

    It's reasonable to allow the webserver to use all resources if you're only hosting static content with thousands of simultaneous visitors. It's also good if you're reverse proxying something that runs on a different server. It sounds terrible if you're doing anything dynamic though.

  • edited September 17

    @mwt said: Allowing your webserver to use all of your system resources by default isn't an objectively good thing.

    Tack on CPUQuota=xx in the service's unit file. Much better than having to configure each service in its own way.

  • @stevewatson301 said:

    @mwt said: Allowing your webserver to use all of your system resources by default isn't an objectively good thing.

    Tack on CPUQuota=xx in the service's unit file. Much better than having to configure each service in its own way.

    Is that a systemd setting? I didn't know that existed. I should actually use that. I have some time insensitive junk that runs on fair use cores.

    I still think 1024 simultaneous connections is a sane default limit for one server. I think it makes some sense to expect someone with 1024 simultaneous connections on each node to not use the default config. From my perspective, that's a lot of connections.

    One core will probably be an issue on arm though. Distributions should probably change the default config for arm. Though, some might have done this already.

  • greenwebpagegreenwebpage Hosting Provider

    In my opinion is the best is nginx not saying Caddy is nto good but if you have any issue you can google it about nxginx and can rezolve any problem very fast
    This is my own opinion

  • @stevewatson301 said:

    @mwt said: Allowing your webserver to use all of your system resources by default isn't an objectively good thing.

    Tack on CPUQuota=xx in the service's unit file. Much better than having to configure each service in its own way.

    My systemd overrides for Caddy:

    sudo SYSTEMD_EDITOR=tee systemctl edit caddy <<EOT
    [Service]
    Restart=on-abnormal
    RestartSec=10s
    CPUAccounting=yes
    CPUQuota=10%
    MemoryAccounting=yes
    MemoryHigh=96M
    MemoryMax=128M
    EOT
    

    This was added after I got weaseled and Caddy crashed.


    @greenwebpage said:
    In my opinion is the best is nginx not saying Caddy is nto good but if you have any issue you can google it about nxginx and can rezolve any problem very fast

    the best is caddy not saying nginx is nto good but if i have any issue i can look at caddy source code and fix it very fast

    Thanked by (1)quicksilver03

    1 of 1 my VirMach VPS is live in Miami, but you should go with Webhosting24 or LevelOne. (paid links)

Sign In or Register to comment.