I didn’t really mean to showcase anything here, but just lift my hat in appreciation on the performance of Caddy.
Originally, I switched to Caddy because I was interested in its HTTP/3 support. Since then I now run all my sites on Caddy, and every problem I’ve had has been solved with the help of the community.
Today I was investigating how Netdata could be used to analyse Caddy logs. It was already possible to use the Prometheus metrics from Caddy, though log files could provide additional insights.
Netdata has a json parser, but needs to map key:values to make sense of things. So what I did was to set it up and then use
h2load to create some requests and bandwidth.
Only much later I looked at the values. Almost 8Gbit/s! Sure, it was a static file on localhost. Still it seemed high considering I was using https with encryption. Just redid the test and sure enough, 766MB/s. Not bad
❯ h2load -n1000 -c10 -m10 "https://wiki.tnonline.net/mediawiki/images/5/5f/20211006_152316_Autum_colours.jpg" starting benchmark... spawning thread #0: 10 total client(s). 1000 total requests TLS Protocol: TLSv1.3 Cipher: TLS_AES_128_GCM_SHA256 Server Temp Key: X25519 253 bits Application protocol: h2 progress: 10% done progress: 20% done progress: 30% done progress: 40% done progress: 50% done progress: 60% done progress: 70% done progress: 80% done progress: 90% done progress: 100% done finished in 12.56s, 79.63 req/s, 766.39MB/s requests: 1000 total, 1000 started, 1000 done, 1000 succeeded, 0 failed, 0 errored, 0 timeout status codes: 1000 2xx, 0 3xx, 0 4xx, 0 5xx traffic: 9.40GB (10091802950) total, 15.96KB (16340) headers (space savings 94.59%), 9.39GB (10086224000) data min max mean sd +/- sd time for request: 159.19ms 2.59s 1.19s 366.88ms 73.80% time for connect: 4.96ms 25.71ms 15.22ms 6.93ms 60.00% time to 1st byte: 38.93ms 88.79ms 55.94ms 18.90ms 80.00% req/s : 7.96 8.13 8.03 0.06 80.00%
The website is my personal wiki which is running on a small home server:
- CPU:2c/4t AMD Ryzen 3000G
- 24GB RAM
- nvme, ssd and hdd based storage
- Gentoo Linux with kernel 6.5.8
- Caddy compiled from git v2.7.5 => /usr/src/caddy/git/caddy@(devel)
- Using golang compiler go1.21.4