Can I use Caddy for a high-traffic site?

Oh sorry! I didn’t realize all the specifics.

Also, that kind of sustained throughput will depend heavily on how well you tune your os tcp stack to deal with high traffic. You are likely to run out of sockets and such handling a high number of small requests.

1 Like

I’m not an expert at all, but does this kind of tuning have a really big impact ? We have not looked at the OS level for now, but NGINX configuration was enough until now.

yes it has a huge difference on performance of system/OS level tuning outside of your web server being used :slight_smile:

I am looking at integrating Caddy into my Centmin Mod LEMP stack installer so needed to evaluate Caddy’s performance and scalability. I did some HTTP/2 based benchmarks back in December 2015 with Caddy 0.8 and my custom installed Nginx setup and you can see the results at https://community.centminmod.com/threads/caddy-http-2-server.5170/.

Now that Caddy 0.9 is out, I’ll be revisiting these benchmarks and comparisons along with my other web server integrations for Apache 2.4, OpenLiteSpeed and H2O web servers into my LEMP stack :slight_smile:

2 Likes

We do about 30req/s sustained and peak to about 1300req/s. It uses headers, proxy and TLS. So far so good.

1 Like

Here’s updated Caddy 0.9 benchmark numbers for h2load HTTP/2 based load tetsing https://community.centminmod.com/posts/34367/

For h2load single thread

For Centmin Mod Nginx 1.11.3 HTTP/2 port 443 = 11,322.50 req/s average

echo "CentminMod.com Nginx 1.11.3 HTTP/2 h2load stress test"; sleep 30; for i in {1..3}; do /usr/local/bin/h2load -c1000 -m100 -n50000 -v https://domain1.com:443 > h2load.$i.log; cat h2load.$i.log | awk '/finished in/ {print $4 " req/s "} /requests: / {print ($8/$2*100)"% completed"}' | tr -d '\n'; echo; sleep 30; done;
CentminMod.com Nginx 1.11.3 HTTP/2 h2load stress test
8896.39 req/s 100% completed
17788.95 req/s 100% completed
7282.18 req/s 100% completed

For Caddy 0.9 HTTP/2 port 448 = 3,751.71 req/s average

echo "Caddy 0.9 HTTP/2 h2load stress test"; sleep 30; for i in {1..3}; do /usr/local/bin/h2load -c1000 -m100 -n50000 -v https://domain1.com:448 > h2load.$i.log; cat h2load.$i.log | awk '/finished in/ {print $4 " req/s "} /requests: / {print ($8/$2*100)"% completed"}' | tr -d '\n'; echo; sleep 30; done;
Caddy 0.9 HTTP/2 h2load stress test
3908.97 req/s 100% completed
3504.25 req/s 100% completed
3841.91 req/s 100% completed
  • CentminMod.com Nginx 1.11.3 HTTP/2 h2load stress test cpu load peaked at 0.60 and 548MB total memory used
  • Caddy 0.9 HTTP/2 h2load stress test cpu load peaked at 1.57 and 1289MB total memory used

For h2load 2 threads https://community.centminmod.com/posts/34379/

  • CentminMod.com Nginx 1.11.3 HTTP/2 h2load stress test cpu load peaked at 0.62 and 551MB total memory used
  • Caddy 0.9 HTTP/2 h2load stress test cpu load peaked at 1.86 and 1393MB total memory used

Note, Nginx was with LibreSSL 2.4.2 compiled but seems OpenSSL 1.0.2h and 1.1.0 would have even better performance https://community.centminmod.com/threads/openssl-1-1-0-pre6-vs-openssl-1-0-2h-vs-openssl-1-0-1e-vs-libressl-2-4-2-vs-libressl-2-3-6.8272/

2 Likes

Thanks for the insights. Really awesome. Would love to see some stats with some plugins like rewrite, proxy, minify.

1 Like

Yes, thanks for running the tests!

Would also love to see some optimizations contributed :wink:

1 Like

Unfortunately not a Golang programmer :blush:

Yeah that would be next up i suppose :slight_smile:

As a general suggestion.
Kubernetes does performance tests as per commit and/or PR and/or release.
It would be great to see the performance impact automatically on PRs/releases I assume.
I will keep it on my “could be done list” until I have time, for anyone faster go for it please.

1 Like

Hey could you profile which part of caddy is eating up the resources?
Maybe its faster with nginx because of AES-NI, i dont know if golang has incorporated support for that.

Since it is written in Go Language:heart_eyes:?

It’s been a while since I tested Caddy for above benchmarks so haven’t profiled as such. Was hoping this discussion would prompt others who know more to look into this as well :slight_smile:

other folks have posted benchmarks too https://ferdinand-muetsch.de/caddy-a-modern-web-server-vs-nginx.html

Could you please give some information (e.g. your caddyfile) that we could setup local test environment?

full details at

for part 1 https://community.centminmod.com/threads/caddy-http-2-server-benchmarks.5170/
for part 2 https://community.centminmod.com/threads/caddy-http-2-server-benchmarks.5170/#post-34346

I use Caddy with HHVM now.

Very loaded site.

20.000 req/s . CPU load 2 and 900MB memory used.

is there a possibility to compile Caddy with LibreSSL 2.4.2 ?

Nope, Caddy uses a Grade-A memory safe TLS implementation only. :grin:

2 Likes

Well, that’s better. My ram is not a problem. There is plenty of room for up to 32GB :sunglasses:

1 Like