Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
mholt
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
40 ms
·
511.
▲
by
mholt
4y ago
Ahh, right -- so there's a lot more to performance than just req/sec and HTTP errors. And that's probably the love/hype you're hearing about. (Though Caddy's req/sec performance is quite good too, as you
512.
▲
by
mholt
4y ago
Yeah, Tyler did an amazing job.
513.
▲
by
mholt
4y ago
> How do these things perform by default. Agreed on this one -- today I'm looking at how to disable metrics by default and make them opt-in. At least until the performance regression can be addressed. Update: PR opened: https:/
514.
▲
by
mholt
4y ago
*and memory safety* This cannot be understated. Caddy is not written in C! And it can even run your NGINX configs. :) https://github.com/caddyserver/nginx-adapter
515.
▲
by
mholt
4y ago
> But disabling metrics is not supported in standard Caddy, you need to remove specirc code and recompile to disable it. We're addressing that quite soon. Unfortunately the original contributor of the feature has been too busy latel
516.
▲
by
mholt
4y ago
I think one reason a lot of benchmarks don't include TLS termination is because it's often impractical in the real-world, where most clients reuse the connection and the TLS session for many requests, thus making them negligible i
517.
▲
by
mholt
4y ago
If that's your whole Caddyfile, might as well not even use a config file: caddy reverse-proxy --from sub.domain.com --to :2345 Glad you like using Caddy!
518.
▲
by
mholt
4y ago
Thanks for the comments and participation! I'm still thinking about that `./`-pattern-matching problem. Will probably have to be addressed after 2.6...
519.
▲
by
mholt
4y ago
Caddy's logger (uber/zap) is zero-allocation. We've found that the writing of the logs is often much slower, e.g. printing to the terminal or writing to a file. And that's a system problem more than a Caddy one. But th
520.
▲
by
mholt
4y ago
You were expecting Caddy to "trounce" nginx? Most people expect the opposite. But Caddy certainly does in some cases, especially with the upcoming 2.6 release.
521.
▲
by
mholt
4y ago
This is a great writeup overall. I was happy to see Tyler's initial outreach before conducting his tests [0]. However, please note that these tests are also being revised shortly after some brief feedback [1]: - The sendfile tests at t
522.
▲
by
mholt
4y ago
Filippo wrote code for that, but said "please don't use it" :) https://words.filippo.io/playing-with-kernel-tls-in-linux-4-...
523.
▲
by
mholt
4y ago
Not necessarily. That's a simple question with a complex answer. There's a lot of "ifs" and maybes and it depends a lot on how the site is set up internally.
524.
▲
by
mholt
4y ago
Those who know, know, that selectively using encryption creates metadata that paints targets on more sensitive communications
525.
▲
by
mholt
4y ago
I'm not sure, I'd have to see what the crypto/tls package does. I would push back against the notion that something like that is "out of scope" for a "general-purpose user-friendly server". Caddy is far fr
526.
▲
by
mholt
4y ago
(Fun-fact, "self-signed" certs also have "CA involvement" -- it's just that the leaf is also the signing authority, which is generally bad practice. Caddy does this properly with a separate signing root -- that stay
527.
▲
by
mholt
4y ago
While I'm glad you recommend Caddy in general, it's worth noting that those advantages come with costs though, too: - Padding: (I'm pretty sure Go already does this too: https://go.dev/src/crypto/tls
528.
▲
by
mholt
4y ago
I have done that test. Go is not significantly faster than Caddy for serving static content.
529.
▲
by
mholt
4y ago
This is actually true some of the time.
530.
▲
by
mholt
4y ago
Caddy 2.6 has some optimizations for serving large files, including sendfile, but other optimizations too. No ktls yet, but maybe someday. It's just... kinda gnarly.
531.
▲
by
mholt
4y ago
So you want to benchmark the network?
532.
▲
by
mholt
4y ago
Marten is in the process of making a bunch of optimizations [0], as are we within Caddy, and 2.6 includes some of those. It will only get better with time. Most users do not operate at nearly the volume required to feel the impact, includin
533.
▲
by
mholt
4y ago
Caddy doesn't cache responses by default, but you can enable caching with the cache plugin: https://github.com/caddyserver/cache-handler/
534.
▲
by
mholt
4y ago
I'm not super familiar with Traefik, but if you're talking about using container labels for config, no, Caddy's config is given as a JSON document through a REST API. The CLI can let you use config files if you prefer. Or the
535.
▲
by
mholt
4y ago
Yes, the docs have been updated at https://github.com/caddyserver/website but haven't been deployed yet. There is a new protocols option: protocols h1 h2 will disable Http/3 but leave 1.1 and 2 on.
536.
▲
by
mholt
4y ago
This is a little-known awesome project! If you like how Traefik is configured with Docker labels but want to use Caddy, well now you can have your cake and eat it, too.
537.
▲
by
mholt
4y ago
Glad you liked it! Caddy's performance is competitive with nginx, but there are too many dimensions to discuss here. I guarantee that for most people, your web server will not be your bottleneck. Dynamic brotli is expensive, as brotli
538.
▲
by
mholt
4y ago
Great points. I also think it's important to stop deploying C to the edge. PS. Go might someday compile for cosmopolitan if someone writes a port for it: https://github.com/golang/go/issues/51900
539.
▲
by
mholt
4y ago
The uri directive can strip_prefix, strip_suffix, or do substring replacements: https://caddyserver.com/docs/caddyfile/directives/uri It can also do regex replacements on the path portion of the URI. And yes,
540.
▲
by
mholt
4y ago
I opened an issue with quic-go to get ideas for a better metric: https://github.com/lucas-clemente/quic-go/issues/3549
More ›