I am wondering if there are any ways to configure Caddy v2 to improve the performance of a reverse proxy.
This is my current configuration as a Caddyfile:
www.postya.net {
reverse_proxy {
to localhost:4000
}
}
Hi matt,
I’m using commit 208f2ff93c1bd2c009e4b96f664c1808ede79f3a
I’m not in much need of more performance right now to be frank, I’m just curios. Caddy solved a problem for me where Nginx reverse proxy caused my application to error silently so I’m a happy camper.
Do you know what it was that caused it? Interested in knowing the difference here.
As for performance, it’s definitely something we can improve on here – just want to get everything in a “working” state first. Do you have any idea what is causing the latency? (Maybe a profile?)
For perf testing, it’d be best to use the JSON config directly (you can use the caddy adapt command to convert what you have over to JSON) so you have complete control over things. In JSON, you’d want keep_alive.max_idle_conns and keep_alive.max_idle_conns_per_host.
I tried what you said with a JSON config and set keep_alive.max_idle_conns and keep_alive.max_idle_conns_per_host to a very high number (100k) but got no real difference in latency with 100 connections.
@jmn On second look, these tests are kind of meaningless since we don’t know what it’s really comparing. (Even getting the configs won’t fully satisfy an answer to that question, because there are many more dimensions involved in benchmarks like these, but at least it’s a start for things we can look into.)
Can you share your full, unchanged nginx config please?