r/opnsense • • 11d ago

caddy plugin + big data transfer = meltdown

Hi

I have set up my opnsense with acme and caddy to get https for my internal services. works great except for when i use my forgejo docker registry. (docker clients dont like insecure registries, hence caddy)

When I pull an image through caddy it goes well for about the first GB, then it starts slowing down and at about 1.5GB it is down to single megabytes per second (hundreds of mb/s without caddy) before opnsense has a stroke and the ui and cli locks up for a minute or so (internet traffic still works)

Looking at top shows me that it is one caddy process maxing out one cpu core. there is plenty of free ram so that cant be the problem.

machine is a VM with 8 cpu cores running on a ryzen 7000 in proxmox and has been absolutely rock steady for the last 4 years.

perhaps u/Monviech has a suggestion?

thanks

4 Upvotes

5 comments sorted by

4

u/1WeekNotice 11d ago

Feel free to ignore this comment as I don't have an answer to your question.

I recommend you let your firewall just be your firewall. With AI there is a lot of vulnerabilities being discovered and this includes reverse proxies. Nginx just had a recent one that is very serious (dubbed nginx2root if you want to look it up)

Not saying this will happen to caddy but you should reduce the risk.

1

u/future_lard 11d ago

thanks for the advice. everything is internal though and the only thing exposed to the internets is wireguard so i feel pretty safe. was hoping to not need to spin up yet another vm for something that opnsense can do already. but might have to...

1

u/1WeekNotice 11d ago edited 11d ago

everything is internal though and the only thing exposed to the internets is wireguard so i feel pretty safe.

My apologies, you did mention this in your post. Sometime when I read quickly I miss the important details.

You are correct and safe.


To talk about your original program. If sounds like the TLS that caddy is doing is being locked to single core. But I'm surprised that is causing issues

How many cores did you assign gour firewall since you are virtualizing it? I assume you already thought of this.

1

u/PassionFar7190 11d ago

It doesn‘t exactly fits to your issue, but I‘ve observed a huge improvement in a similar setup after enabling TCP RACK.

This also affects other TCP connections terminated by the firewall iself, e.g. ha.

1

u/Monviech 11d ago

If its about performance you can create a profile and go upstream if you find something weird.

https://docs.opnsense.org/manual/how-tos/caddy.html#get-help-from-the-caddy-community

Like another comment said maybe try TCP RACK as well.