News for hackers. Stuff that matters.
Re:Caddy – Open-source web server with automatic HTTPS by PragmaticPulp on Monday November 29, 2021 @10:34AM (#29380995)
I love what the Caddy project is doing, but every time I look into it I can’t get a straight answer about performance.

One of the top search results for Caddy performance is this Caddy forum thread with a response from the Caddy author: https://caddy.community/t/performance-compared-to-nginx/7993

But it seems to be dodging the question and linking to the most misleading possible Tweets instead of providing any actual info:

> Caddy is written in Go. It will perform just as well as any other Go web servers.

> Google, Netflix, Cloudflare, Fastly, and other large network companies deploy Go on their edge. You can too.

What a bizarre response.

They then link to a Tweet from someone who claims that Caddy performed 20X better than nginx. An impressive claim! But further investigation shows that virtually every other benchmark I can find shows the opposite situation: Nginx beating Caddy by up to 8X.

Performance isn’t everything and there are plenty of situations where Caddy’s ease of use might prevail, but I get nervous when project authors are giving cagey and misleading responses to straightforward (and important) questions.

Re:Caddy – Open-source web server with automatic HTTPS by cunthorpe on Monday November 29, 2021 @11:18AM (#29381588)
It’s funny that your complaint about opaque answers got responses that imply that performance doesn’t matter.

What this tells me is that Caddy is slower than its competitors and they know it. If it wasn’t, then they wouldn’t hide behind meaningless responses.

Basically they answered without answering.

Re:Caddy – Open-source web server with automatic HTTPS by francislavoie on Monday November 29, 2021 @11:42AM (#29381922)
You misunderstood then, because what was said was essentially "official benchmarks for servers are meaningless", not that "performance doesn't matter". Do your own testing, for your own usecase.

But still, a server should rarely ever be your bottleneck. Your application's DB I/O will be.

Re:Caddy – Open-source web server with automatic HTTPS by PragmaticPulp on Monday November 29, 2021 @12:07PM (#29382248)
> You misunderstood then, because what was said was essentially "official benchmarks for servers are meaningless", not that "performance doesn't matter". Do your own testing, for your own usecase.

The Caddy forum thread I linked to above highlighted a Tweet about Caddy being 20X more performant than nginx. This was from the Caddy team.

The frustrating part is how benchmarks are championed as a selling point when they benefit the project, but the argument becomes “official benchmarks are meaningless” as soon as they don’t.

That, and the weird opaque responses and insistence that we debate my performance requirements on the internet when I just wanted to know how Caddy compares to nginx in the most broad terms. Similar performance? Order of magnitude faster? Order of magnitude slower? Why does such a large debate have to erupt when such simple questions are asked?

If Caddy is good for one use case but not for others, why not just say it? Why must it become a one-on-one debate? I don’t literally have one use case for a web server. I want to know when it’s appropriate to choose so I can make these decisions myself without engaging in an HN comment section back-and-forth to figure it out.

Re:Caddy – Open-source web server with automatic HTTPS by ksec on Monday November 29, 2021 @01:42PM (#29383469)
I think generally speaking, if you really want or care about performance you shouldn't be using Caddy.

The link you provided had some results from eva2000, I think those are good indication of how Caddy performs. I have used some of his work since... I think some 20 years ago. ( Jeez.... ) So he has been testing server and frameworks all the way back since CGI-Bin era.

But I do understand the frustration, may be Caddy should be up front about it. On the other hand I can see how the author doesn't want to do benchmarks. If you have to benchmarks this may not be for you.

I do wish they at least had memory usage on their web site. Although in my testing it is always less than 100MB I dont bother much with it on a low traffic website.

Re:Caddy – Open-source web server with automatic HTTPS by francislavoie on Monday November 29, 2021 @12:11PM (#29382303)
> The Caddy forum thread I linked to above highlighted a Tweet about Caddy being 20X more performant than nginx.

That's just saying Caddy _can_ be faster, it's not saying Caddy _is always_ faster. That was never claimed.

> when I just wanted to know how Caddy compares to nginx in the most broad terms

But that's impossible. There's no way to "generally" benchmark a web server. There's just way too many ways it can be used for any single benchmark to ever be valid.

Do your own benchmarks, for _your_ usecase. That's the only way you'll get any kind of real answer.

Re:Caddy – Open-source web server with automatic HTTPS by Eldt on Monday November 29, 2021 @12:52PM (#29382835)
Think I found the Caddy developer.
Re:Caddy – Open-source web server with automatic HTTPS by francislavoie on Monday November 29, 2021 @12:56PM (#29382875)
Yes, I'm a maintainer. What's your point?
Re:Caddy – Open-source web server with automatic HTTPS by TimWolla on Monday November 29, 2021 @01:47PM (#29383547)
One thing would be indicating that you are a maintainer in your comment, when it's not immediately obvious, so that readers are able to understand your comment in a proper context. Like I will do at the bottom of my comment:

Disclosure: Not a Caddy user. Turned off from it by the maintainers shamelessly plugging Caddy as the best thing since sliced bread whenever a competitor is mentioned somewhere. I'm also a community contributor to HAProxy which might or might not be considered a competitor.

Re:Caddy – Open-source web server with automatic HTTPS by FpUser on Monday November 29, 2021 @01:26PM (#29383276)
>"But still, a server should rarely ever be your bottleneck. Your application's DB I/O will be."

I have C++ server. Instead of constantly querying DB it holds all business data in RAM in appropriate structures optimized for real time usage, not how they're kept in DB. All read requests are basically limited by network IO except when some request calculates some more or less complex math. No waiting for DB. Writes are batched and a frequency of those is way less than that of reads.

It reverse proxied by Nginx. Putting Caddy instead would be a disaster if Caddy is much slower.

Re:Caddy – Open-source web server with automatic HTTPS by mcspiff on Monday November 29, 2021 @02:41PM (#29384243)
Not to diverge too much, but if you’re keeping everything in memory how do you handle hardware failures etc? Wouldn’t that result in data loss?
Re:Caddy – Open-source web server with automatic HTTPS by FpUser on Monday November 29, 2021 @02:49PM (#29384325)
Data is written to disk but requests are batched and executed as a single transaction. It is very fast. Partner systems know that the request may fail and business processes are organized accordingly. In practice it never really happens. The overall performance is insane (hundreds of times better) comparatively to some Python scripts fishing in database for every request.
Re:Caddy – Open-source web server with automatic HTTPS by kreetx on Monday November 29, 2021 @11:35AM (#29381825)
Yup. They should just say "it's the ease of use" and be done with it. It's a pretty good reason to use a technology.
Re:Caddy – Open-source web server with automatic HTTPS by earthboundkid on Monday November 29, 2021 @10:57AM (#29381298)
I think the point is just that for most applications, the reverse proxy server is not a performance bottleneck, so it doesn't matter for any practical purpose. Caddy could be twice as fast or slow and it would not change the number of servers you need to deploy one way or another. If your reverse proxy is a bottleneck, you'll know and probably have the resources to build something custom instead of using Caddy or whatever.
Re:Caddy – Open-source web server with automatic HTTPS by PragmaticPulp on Monday November 29, 2021 @11:09AM (#29381457)
> I think the point is just that for most applications…

I guess it would make more sense if they came right out and said that it’s best used for these applications where it’s acting as a reverse proxy for a heavy backend and therefore performance isn’t a big issue.

But I’m constantly confused by the vague responses combined with the allusions to claims that it’s super-fast because it uses Go like Google or Tweets about it being 20X more performant than nginx when it’s clearly not.

Re:Caddy – Open-source web server with automatic HTTPS by mholt on Monday November 29, 2021 @11:19AM (#29381594)
It's hard to quantify web server performance in a way that is both truly representative and truly generalizable, such that you can draw correct conclusions for specific setups and use cases. Ultimately we just recommend you do your own tuning and performance testing, especially since so many external factors are involved.
Re:Caddy – Open-source web server with automatic HTTPS by philipwhiuk on Monday November 29, 2021 @02:39PM (#29384225)
That would have been a better answer than "it performs as well as every other Go server" which probably does a dis-service to any tuning work you've done (or any tuning work any other server has done on the thin chance you've not done any).
Re:Caddy – Open-source web server with automatic HTTPS by brownjohnf on Monday November 29, 2021 @01:39PM (#29383427)
> I think the point is just that for most applications, the reverse proxy server is not a performance bottleneck

I'm not commenting either way on Caddy vs. other solutions, but whether or not a reverse proxy is a pure performance bottleneck, it can become a cost issue. If a reverse proxy is capable of handling twice as much traffic as another solution (through some combination of simultaneous connections and raw speed), it'll cost half as much to operate. Especially at scale, those costs can really matter.

Raw speed for speed's sake is only sometimes the most important factor.

Edit: grammar.

Re:Caddy – Open-source web server with automatic HTTPS by jrockway on Monday November 29, 2021 @01:47PM (#29383555)
For me, reverse proxy capacity is more about surviving machine failures. I'll need N+2 of them per region per zone regardless of how efficient they are. For my simple personal site, I run Envoy on 3 machines limited to 64M of RAM and it easily supports 10,000qps per instance with many more concurrent connections (for clients downloading the requested document slowly). One instance alone is enough for all the capacity I desire (and I have rate limits to prevent one IP from using more than its fair share of the limited capacity), so I pay for 128M of RAM that I don't need simply to survive VM failures during a deployment.

I guess my point is that even an inefficient proxy is going to be light on resource usage, and you will always need extras. At some scale, the inefficiency matters, but at most scales it really doesn't. So if Caddy is easy to operate, I'd say go for it. (But personally I use envoy + cert-manager. More flexible and less magic.)

Re:Caddy – Open-source web server with automatic HTTPS by emteycz on Monday November 29, 2021 @11:06AM (#29381416)
Yeah but this means that you could wait 8x longer with NGINX before building a custom solution.
Re:Caddy – Open-source web server with automatic HTTPS by throwaway894345 on Monday November 29, 2021 @12:01PM (#29382160)
Which itself is pretty meaningless considering almost no one bottlenecks on their reverse proxy.
Re:Caddy – Open-source web server with automatic HTTPS by pachico on Monday November 29, 2021 @11:57AM (#29382115)
Can't think of any situations I was involved where the bottleneck was the http server app rather than the application behind it. Am I the only one?
Re:Caddy – Open-source web server with automatic HTTPS by PragmaticPulp on Monday November 29, 2021 @12:01PM (#29382161)
If you’re only serving up heavyweight web apps, then this is probably true.

But Caddy also markets itself as an efficient static file webserver right on the home page:

> Caddy is both a flexible, efficient static file server and a powerful, scalable reverse proxy.

Perhaps the confusing part is the way that Caddy is marketed as “The Ultimate Server” when instead it’s designed to be a fast-enough reverse proxy for applications where performance doesn’t matter. There are many applications where performance really does matter. Static file serving is the most obvious example.

Re:Caddy – Open-source web server with automatic HTTPS by throwaway894345 on Monday November 29, 2021 @12:12PM (#29382309)
> There are many applications where performance really does matter.

Like what? Genuine question. I'm sure a cloud provider's layer 7 load balancer / Kubernetes Ingress would merit an optimized implementation but beyond those kinds of super-scale use cases I can't think of much.

Re:Caddy – Open-source web server with automatic HTTPS by Bayart on Monday November 29, 2021 @12:12PM (#29382308)
As the other person that answered to you pointed out, there's a point where your HTTP server becomes the bottleneck, ie your backend being more concurrent and faster at producing content than your server is at delivering it.

But I feel the real bottleneck is developer pain. I switched to nginx from Apache like everyone else because nginx was nice to use and Apache wasn't. The performance aspect was only a rationalization.

Re:Caddy – Open-source web server with automatic HTTPS by mekster on Monday November 29, 2021 @08:13PM (#29387576)
What was not so nice about Apache?

Mentioning without context sounds like an emotional one.

Re:Caddy – Open-source web server with automatic HTTPS by Bayart on Tuesday November 30, 2021 @04:50AM (#29390511)
I found Apache configuration to be cumbersome and hard to read, with nginx being comparatively clean and making reverse-proxying and caching easy. Keep in mind that was other a decade ago. I don't know where Apache is now, it's not something I have reassessed and I don't know if I would make the same choices with my current experience.
Re:Caddy – Open-source web server with automatic HTTPS by rampointerhater on Monday November 29, 2021 @12:08PM (#29382258)
No. But looking at the site Caddy appears to be a product for easy and quick deployment, so that zero-knowledge people can run a web server. Their point is unlikely to be performance, it is probably in the lines of "low code".
Re:Caddy – Open-source web server with automatic HTTPS by mholt on Monday November 29, 2021 @10:49AM (#29381179)
What are your performance requirements?
Re:Caddy – Open-source web server with automatic HTTPS by yjftsjthsd-h on Monday November 29, 2021 @11:42AM (#29381924)
This is exactly what the original complaint was: Someone complains that Caddy is slower than the options, and the official response is not neither agreement nor giving data to show that Caddy is fast, but equivocating about whether it matters while avoiding commenting on whether the claim is true. If you want to ship a webserver that's slower but safer and easy to use, that's fine; I'm using Caddy to host my stuff because that's a reasonable trade off. It's just the dodging of the question that gets old fast.
Re:Caddy – Open-source web server with automatic HTTPS by throwaway894345 on Monday November 29, 2021 @12:14PM (#29382345)
The claim can't be evaluated as "true or false", which is the point. The use cases for Caddy and similar software are too broad to be meaningfully approximated as a binary or scalar value.
Re:Caddy – Open-source web server with automatic HTTPS by yjftsjthsd-h on Monday November 29, 2021 @12:20PM (#29382423)
I'm pretty sure you can approximate it to true - are there any cases where Caddy is faster than another webserver in the same usecase, with either default or tweaked configs on both?
Re:Caddy – Open-source web server with automatic HTTPS by throwaway894345 on Monday November 29, 2021 @12:28PM (#29382521)
Yes, you can get very gritty microbenchmarks, but those always fail to generalize well and lead to more confusion. Most people will make bad decisions off of microbenchmarks and those who won't will tell you they're nearly useless in the best case.
Re:Caddy – Open-source web server with automatic HTTPS by vxNsr on Monday November 29, 2021 @11:48AM (#29381995)
just fyi, based on the bio of the person you're replying to, they're the author of caddy. not sure if this was known or not
Re:Caddy – Open-source web server with automatic HTTPS by yjftsjthsd-h on Monday November 29, 2021 @11:59AM (#29382135)
Yes, that's why I am treating that comment as an official response.
Re:Caddy – Open-source web server with automatic HTTPS by mholt on Monday November 29, 2021 @11:55AM (#29382092)
Yeah, it's hard for us to hit a performance target that is being kept hidden from the devs.
Re:Caddy – Open-source web server with automatic HTTPS by qbasic_forever on Monday November 29, 2021 @12:17PM (#29382390)
This shouldn't be downvoted--it's very true, what performance are you trying to optimize? Throughput of long connections? Time from connection to first bytes? There are dozens of dimensions to web performance.
Re:Caddy – Open-source web server with automatic HTTPS by yjftsjthsd-h on Monday November 29, 2021 @12:21PM (#29382437)
That's totally reasonable. Does Caddy actually win on any of those dimensions?
Re:Caddy – Open-source web server with automatic HTTPS by withinboredom on Tuesday November 30, 2021 @02:03AM (#29389698)
There are millions of configurations for Caddy (which modules you compile into the binary) so this is literally impossible to know unless your benchmark your particular configuration for your particular use case.
Re:Caddy – Open-source web server with automatic HTTPS by vxNsr on Monday November 29, 2021 @03:32PM (#29384877)
I didn't mean my comment to come off as hostile. The way you replied seemed to imply you were involved in some way but didn't make note of that in your comment, sometimes when people don't realize who they're replying to they make bad assumptions, I was trying to prevent that from happening.

This whole thread has a lot of unproductive animosity, and it's possible part of that is due to the opaqueness who the identity of those involved.

Re:Caddy – Open-source web server with automatic HTTPS by PragmaticPulp on Monday November 29, 2021 @10:56AM (#29381289)
> What are your performance requirements?

If the requirements were such that web server performance didn’t matter, I wouldn’t care and wouldn’t be asking about it.

But the problem is that it doesn’t make sense to hide the performance statistics and then debate each user’s performance requirements instead of just letting the performance be a known quantity so we can all decide for ourselves.

Re:Caddy – Open-source web server with automatic HTTPS by mholt on Monday November 29, 2021 @11:20AM (#29381607)
We aren't "hiding" any performance stats. They just don't exist. It's super hard to generate them in a way that applies perfectly to everyone's use case.

I'm still waiting to hear your performance requirements btw.

Re:Caddy – Open-source web server with automatic HTTPS by Zababa on Monday November 29, 2021 @12:39PM (#29382671)
On the Caddy website (https://caddyserver.com/) it says:

> Caddy is both a flexible, efficient static file server and a powerful, scalable reverse proxy.

> LIGHTWEIGHT For all its features, Caddy runs lightly and efficiently with relatively low memory footprint and high throughput.

> STATIC FILES By default, Caddy will serve static files in the current working directory. It's so brilliantly simple and works fast.

> Caddy's HTTP server has a wide array of modern features, high performance, and is easy to deploy.

Emphasis with the italics being mine. All of these seem to hint at performance comparaisons being done in specific domains agaisnt other web servers. For example:

- efficient static file server: I would assume that "efficient" here is compared to other file servers, though that could mean also that it doesn't use much resources

- For all its features, Caddy runs lightly and efficiently with relatively low memory footprint and high throughput: That seem to imply that other servers with all these features are heavier and less efficient? Or that other servers just don't have those features? Relatively low memory footprint and high throughput? Relative to what?

- It's so brilliantly simple and works fast: What does fast mean here? Fast relative to what? Apache? The standard Go static file server? Python SimpleHTTPServer?

- high performance: High compared to what?

My goal here isn't to be confrontational. My point is that if there are all those claims on the main page of Caddy, then you must at some point have measured performance, resource usage and things like that against other servers. I think what people are asking is to substantiate those claims with data. You're right that it's hard to generate data in a way that applies perfectly to everyone use case. But then on what do you base all these claims? Why is Caddy called "the ultimate server"? At least that's why I'm wondering.

Re:Caddy – Open-source web server with automatic HTTPS by mholt on Monday November 29, 2021 @12:53PM (#29382839)
Not everything needs to be read as a comparison to other products. Adjectives have meaning without competition. They can be interpreted as ratios, for example requests / available memory, or load / latency.

It's not always about putting down other products. Both can be fast. Both can be efficient. Both can be fast and light. Both can be "high" without one having to be low in order for it to be valid to call it "high" -- because it's not always about the other product.

This discourse makes me exhausted, every time it comes up. I'm tired of everyone thinking I'm trying to outperform NGINX. Caddy's just fast and efficient, I don't care to defend that claim as much as people care to attack it.

Re:Caddy – Open-source web server with automatic HTTPS by Zababa on Monday November 29, 2021 @01:29PM (#29383314)
I mean, I get your point, but adjectives don't exist in a vacuum. If everything is fast, everything is slow too, and nothing is fast too, because everything is the same. When you use an adjective like "fast" or "slow", you're separating yourself from the whole, and you're putting the thing you're talking about in a category. Of course this is relative. You can be a fast marathon runner. You can be a fast human. Or a fast animal. Or a fast car, or plane. All of those have vastly different speed. But they still have meaning.

Now, Caddy is a web server. You say that it's fast and efficient. I'm not putting that into question. But what do you base that on? What would it take for Caddy to be judged as "slow" or "inefficient" by you? Maybe you don't have a precise answer, and that's perfectly okay. But you must have a way to evalute what's slow and what's fast, even when not comparing to other product. At least that's how I (and I assume, the people asking you all these questions) think.

> This discourse makes me exhausted, every time it comes up. I'm tired of everyone thinking I'm trying to outperform NGINX.

That's fair, and I can empathize. However, I think that's what will happen when the first thing people see on the website of Caddy is "THE ULTIMATE SERVER". Ultimate, for a good amount of people, is related to performance, so people are going to ask you about that. And when they don't get a clear answer, they're going to get frustrated.

Again, I'm not trying to be confrontational here. But there seems to be a real lack of understanding in this conversation, and I'm trying to clarify what people mean when they ask about Caddy's performance.

Re:Caddy – Open-source web server with automatic HTTPS by Xevi on Monday November 29, 2021 @02:29PM (#29384094)
Then what do they mean to you? I think people are just trying to understand. What is "fast" and "efficient" to you? Where do you draw the line?

When it comes to tech in particular, things are pretty much always compared relative to each other, because there's very little other reference points. React is generally deemed as slow relative to Svelte. Rust is more efficient than Python at runtime. These claims mean very little in a vacuum, in fact I'd say that they are almost pointless. You can't base you business decisions on claims that haven't been backed up by data. And if you do, you might regret them later on.

Re:Caddy – Open-source web server with automatic HTTPS by PragmaticPulp on Monday November 29, 2021 @11:54AM (#29382078)
> I'm still waiting to hear your performance requirements btw.

I suppose this encapsulates why I get turned off of Caddy every time I look into it: Basic concerns (including questions about approximate performance) are met with suggestions that I don’t know what I want and therefore I’m not qualified to make such judgments.

Re:Caddy – Open-source web server with automatic HTTPS by throwaway894345 on Monday November 29, 2021 @12:02PM (#29382173)
You're being unduly defensive. mholt is telling you that he can't provide meaningful general purpose performance numbers because the breadth of cases for Caddy vary too widely, so he's asking you for information about your specific use case so he can give you the very information you're complaining about not being able to access, but you're being cagey about sharing those requirements.

You're certainly within your rights to not use Caddy, but it makes no sense to complain that you can't get the performance information you need when you won't share any information about your use case.

Re:Caddy – Open-source web server with automatic HTTPS by PragmaticPulp on Monday November 29, 2021 @12:10PM (#29382283)
> but you're being cagey about sharing those requirements.

I don’t have one single set of requirements for every location I use a web server. Nobody does.

If Caddy is good for one thing but not so good for other things, why is it so hard to come out and say that?

Also, the benchmark I was questioning in the opening comment came from mholt on the official community forum. It’s mind boggling that I’m getting attacked for questioning the benchmark result that they provided in the first place.

Re:Caddy – Open-source web server with automatic HTTPS by joshmanders on Monday November 29, 2021 @12:23PM (#29382469)
Nobody is attacking you. Calm down, yeesh.

You want performance metrics, but can't even tell us what metrics matter to you, but expect Matt and Caddy team to have them just available... You understand that your responses here are directly proving his point on not having them, right?

Re:Caddy – Open-source web server with automatic HTTPS by stronglikedan on Monday November 29, 2021 @12:29PM (#29382530)
> mholt is telling you

It's not what he's saying, but how he's saying it. "I'm still waiting to hear your performance requirements btw.", is a condescending, dismissive tone that would put more people off than not. Especially considering it was a reply within just a couple minutes of his initial question.

Re:Caddy – Open-source web server with automatic HTTPS by mholt on Monday November 29, 2021 @12:43PM (#29382709)
Sorry, don't mean to be condescending or dismissive. Just trying to get stuff done. To do that, I'll need that information.
Re:Caddy – Open-source web server with automatic HTTPS by genewitch on Monday November 29, 2021 @02:40PM (#29384237)
I've only used caddy twice, but it worked for like 2 years without interruption both times.

I don't think you're being negative or whatever and I also think the other person has an idea of what they want to know but not how to explain it.

Do they want connection handling metrics? SSL terminations? Caching performance?

Also, not at you but a general laugh, "the reverse proxy isn't the bottleneck ever" is funny because prior to haproxy, getting gigabit throughput to a backend was considered extreme engineering.

Now I can load balance and ssl terminate a gigabit with like 5 raspberry pi and an old Intel box to load balance and cache.