News for hackers. Stuff that matters.
Re:Caddy 0.10 Released by blowski on Friday April 21, 2017 @08:35AM (#14164941)
When would I use Caddy, rather than using nginx and configuring Let's Encrypt for myself? Honest question.
Re:Caddy 0.10 Released by grey-area on Friday April 21, 2017 @09:17AM (#14165263)
It's a lot easier than ngxinx + letsencrypt + cron job - there is zero config to get letsencrypt up and running and certs renewing automatically.

It supports http2 out of the box and will keep improving as the go net/http library does, performance is good (certainly good enough for 99.9% of the static sites out there, I haven't specifically benchmarked against nginx but response times didn't change much). I'd recommend it as a proxy if you need one, particularly if you need one that handles your tls certs.

Re:Caddy 0.10 Released by shawabawa3 on Friday April 21, 2017 @08:50AM (#14165058)
Why would I use nginx and go through the hassle of configuring let's encrypt and sane SSL settings when I could just use caddy?

But seriously, for all "hobby" projects I've started recently, and even some production services now, I go straight to caddy.

My config consists of a 1 line global config file:

    import sites-enabled/*
And 90% of the individual services have this config:

    example.com {
      proxy / http://localhost:5000 {
        header_upstream Host {host}
      }
    }
Compared to nginx it's just so much simpler and so far I haven't found myself missing a single feature. (In fact, caddy has active health checks, which nginx only supports for its extortionate enterprise fee)
Re:Caddy 0.10 Released by blowski on Friday April 21, 2017 @08:53AM (#14165086)
What's the performance like? Can you use it as a proxy server?
Re:Caddy 0.10 Released by shawabawa3 on Friday April 21, 2017 @09:03AM (#14165162)
I use it exclusively as a proxy server.

I've never noticed any performance issues, I think I saw a benchmark where it said caddy can handle 2000req/s, which is at least an order of magnitude or 2 faster than any upstream service I've used it in front of.

Re:Caddy 0.10 Released by coldtea on Friday April 21, 2017 @09:25AM (#14165329)
>I think I saw a benchmark where it said caddy can handle 2000req/s

Those are application level numbers (e.g. with logic and all).

Caddy should be able to handle an order of magnitude more req/s than that easily.

Re:Caddy 0.10 Released by anc84 on Friday April 21, 2017 @10:20AM (#14165815)
Re:Caddy 0.10 Released by shawabawa3 on Friday April 21, 2017 @12:24PM (#14166950)
yeah, I clearly misremembered the benchmark

It was slightly slower than nginx, but not enough to impact typical applications

Re:Caddy 0.10 Released by StreamBright on Friday April 21, 2017 @10:10AM (#14165746)
2000 req/s is tragic. We have services with 100 000req/s so i need a reverse proxy with at least 500 000 req/s. What is the reason of this low performance?
Re:Caddy 0.10 Released by StreamBright on Friday April 21, 2017 @02:31PM (#14168057)
I am not sure why this is getting downvoted, care to explain?
Re:Caddy 0.10 Released by MichaelGG on Friday April 21, 2017 @05:21PM (#14169519)
My guess: At 500Krps on a single proxy you're probably using 40GbE or higher right? So you're a fairly niche user and should have some sort of in-depth knowledge of this space. Your current setup should already some sort of horizontal scaling system in place. Just throwing out you "need" a 500Krps came across as fake boasting/clueless/whiny.

I'm sure HN would love a more in-depth comment where you say how you're accomplishing things today and what you expect out of general purpose reverse proxies, etc.

Re:Caddy 0.10 Released by StreamBright on Saturday April 22, 2017 @04:13AM (#14171617)
If your HTTP request size is 2048 bytes and the RPS is 500000 we get 1024000000 bytes / sec that is ~ 8 Gbit/s, lets say with overhead we are hovering around 10Gbit/s. Based on the response size you can do similar calculation. As you can see in the TechEmpower benchmarks frameworks with 3M+ req/s are not uncommon.

https://www.techempower.com/benchmarks/#section=data-r12&hw=...

This is on Dell R720xd dual-Xeon E5 v2 + 10 GbE. Now if I chose technology that cuts this performance 200x times I am wasting resources.

I like to idea of Caddy but before we can consider using it in production I need to make sure it can keep up with the performance requirement we got.

Re:Caddy 0.10 Released by MichaelGG on Saturday April 22, 2017 @12:13PM (#14173168)
Yeah but as a proxy you need to add the request and response and you get that much full duplex. Those numbers are also with pipelining returning a tiny static response - basically as close to a TCP echo test as you can get.
Re:Caddy 0.10 Released by yjftsjthsd-h on Friday April 21, 2017 @09:14AM (#14165244)
It can act as a reverse proxy, yes. I would also love to see some performance benchmarks.
Re:Caddy 0.10 Released by indeyets on Friday April 21, 2017 @01:46PM (#14167652)
Proxy-server performance is fine.

File-serving performance — not so good.

Re:Caddy 0.10 Released by nemothekid on Friday April 21, 2017 @10:07AM (#14165721)
A lot of the other responses have been focusing on how simple Caddy is to get started with - batteries included. We've been using Caddy for a bit over 2 years in production. At the time we had just moved our infrastructure from an assortment of self-written python scripts to Mesos/Marathon. We were looking for a solution that would reverse proxy to our app servers without having to rely on DNS. I initially thought about writing a plugin for nginx before I found Caddy. When we found Caddy, it was a better solution for us as it was far easier to write a mesos integration for rather than trying to integrate it into nginx.
Re:Caddy 0.10 Released by singlow on Friday April 21, 2017 @09:35AM (#14165425)
I use Nginx in production, but caddy on my dev machine, where I might have dozens of test sites running at any time. Those sites all live on subdomains of a dedicated dev domain and I rarely create more than 2 or 3 per week so I can always just use https with certificates generated on the fly. In Nginx I would need to constantly re-run certbot to add subdomains manually.
Re:Caddy 0.10 Released by eliaspro on Friday April 21, 2017 @03:31PM (#14168635)
For all local/non-public instances I just use "tls self_signed" and have Caddy generate a cert on demand.
Re:Caddy 0.10 Released by knrz on Friday April 21, 2017 @08:39AM (#14164969)
I feel like the niche Caddy's trying to fill is for people who don't want to bother with that, or don't want to learn. If you already know how to set up nginx and LE (like you and I do), its only appeal is relatively minor: potentially saving a quarter or half hour.
Re:Caddy 0.10 Released by interfixus on Friday April 21, 2017 @09:08AM (#14165195)
its only appeal is relatively minor

Is that factual, or also something you feel like?

To us simple folks, you know, it looks as if Caddy has a number of use cases where it's a much neater fit than nginx. We like the extreme simplicity and the transparency of it all. Some of us also like the Go it's written in. What with the magic Go modularity, you can actually embed this server in your web-app. Or is it the other way round? Comes in handy, at any rate.

Re:Caddy 0.10 Released by grey-area on Friday April 21, 2017 @10:16AM (#14165791)
What with the magic Go modularity, you can actually embed this server in your web-app. Or is it the other way round? Comes in handy, at any rate.

It's the other way round.

You can embed your app in the server if you want to get its features for free, though given it uses net/http and most of the features are exposed there you should probably just use that directly instead if you are doing anything significant.

Re:Caddy 0.10 Released by knrz on Friday April 21, 2017 @09:20AM (#14165280)
That was a feel. I never thought of the idea of embedding it. Thanks for teaching me more!
Re:Caddy 0.10 Released by overcast on Friday April 21, 2017 @10:21AM (#14165828)
When you're a solo entrepreneur/developer/sysadmin/whateverhatineed hat I need to wear. Streamlining processes as much as possible is a good thing. Using something overly complex, just to use it, is silly. I stumbled upon Caddy, because I was struggling with getting LetsEncrypt setup properly for all my sites on Nginx. Now with a few lines of config, all my sites use, redirect to, and update their certificates automatically. One less piece of bullshit I need to sift through for all the projects I'm working on. In my opinion, something like SSL certificates SHOULD be an automated process.
Re:Caddy 0.10 Released by yjftsjthsd-h on Friday April 21, 2017 @09:19AM (#14165274)
I'm not opposed to learning, but it's like learning emacs when nano legitimately covers all your use cases: potentially useful, but unconvincing ROI. And if we pretend for a moment that it's really only a quarter hour saved, why would I not save that time if all other things are held fixed?

Caddy isn't the universal solution, but it sounds like you're rationalizing using the more complex tool because you know it and have been using it rather than because it's necessarily superior.

Re:Caddy 0.10 Released by atonse on Friday April 21, 2017 @09:32AM (#14165392)
The appeal is huge for a huge number of people. It's an opinionated web server. I've used nginx for probably 6-7 years, and not once have I done something I'd consider that special (I've setup fpm, passenger, gzipping of content, TLS, regenerating my DH param, etc).

Every single thing I've done, could be implemented in an opinionated away by the web server. I'd love to just say "php" and have it do the right thing.

In fact, I'd go as far as to say, it would be amazing if I could just say "proxy ____ drupal" instead of php, and it'll add the drupal rules as well.

Re:Caddy 0.10 Released by andmarios on Friday April 21, 2017 @01:49PM (#14167675)
It all depends on how complex your setup is. Caddy isn't just easy to setup, it is easy to setup every part of it until you reach the end of its functionality.

I can set up both nginx and apache (and get paid for it), I've automated LE for new sites via ansible, etc. Nowadays if I can do with caddy, I just use that and proceed to the next task. Also remember that easy (and short) configuration means easier maintenance.

Devs also love it, they can develop locally using advanced functionality (e.g proxying an API that doesn't provide CORS).

Re:Caddy 0.10 Released by xiphias on Friday April 21, 2017 @08:51AM (#14165072)
I think over time there will be a similar server written in Rust, where at least we can be sure that there are no buffer overflows..until then nginx is probably better in every situation.
Re:Caddy 0.10 Released by coldtea on Friday April 21, 2017 @09:27AM (#14165344)
Unless it uses unsafe code (which Rust also provides) Caddy wouldn't have buffer overflows either, since Go is garbage collected and doesn't allow for the kind of pointer arithmetic C does in normal code.
Re:Caddy 0.10 Released by shawabawa3 on Friday April 21, 2017 @09:04AM (#14165171)
Caddy is written in go, not C, so I'm not sure why it should be especially vulnerable to buffer overflows...
Re:Caddy 0.10 Released by Sphax on Friday April 21, 2017 @09:27AM (#14165341)
Do we really need someone to mention Rust in every thread ?
Re:Caddy 0.10 Released by xiphias on Saturday April 22, 2017 @01:31AM (#14171236)
No, it just makes sense to have a fast and safe HTTP server at the same time.

Go is ona average 3x slower than C according to bechmarks, and it's hard to get rid of this issue because of how the language is architected. I just don't see Caddy as a possible long term replacement for nginx.

Re:Caddy 0.10 Released by afdsadf on Friday April 21, 2017 @12:02PM (#14166736)
As a member of the Rust Evangelism Strike Force, I am morally obligated to. /s
Re:Caddy 0.10 Released by anaganisk on Friday April 21, 2017 @09:32AM (#14165397)
someone had to say it :p
Re:Caddy 0.10 Released by ilogik on Friday April 21, 2017 @09:03AM (#14165160)
why would there be buffer overflows in caddy?
Re:Caddy 0.10 Released by dev247 on Friday April 21, 2017 @08:47AM (#14165039)
I made the complete switch to Caddy just because the configuration is simplified and it has features like git webhooks built-in. Setting up BasicAuth on a directory is one line in the config. And it's fast. No issues so far, been using Caddy for over a year now.
Re:Caddy 0.10 Released by anc84 on Friday April 21, 2017 @09:03AM (#14165156)
I vouched for this comment to bring it back from dead. dev247, you seem ghosted for all the account's lifespan for no apparent reason. Contact [email protected] to get reset to a proper user account!
Re:Caddy 0.10 Released by interfixus on Friday April 21, 2017 @09:09AM (#14165210)
So did I. What's the deal with this absolutely harmless comment being going all grey and dead?
Re:Caddy 0.10 Released by anc84 on Friday April 21, 2017 @09:17AM (#14165264)
The account was probably automatically flagged by some algorithm 3 years ago. Yay for smart machines and no human oversight!