This is another alternative for adjusting CAKE's bandwidth
and rtt
parameters automatically that is inspired and adapted from the cake-autorate project by @Lynx
Right now it's probably not an all-in-one solution, and other similar implementations are great already, but still kind of pushing users to understand what parameters to change, I'd say.
The goal is an ease of use for anyone who's already familiar with dnscrypt-proxy, and from the user's perspective, the user should only worry about setting up the interface names, and the min/max UL/DL limit for adjusting CAKE's shaper.
It's trying to measure RTT based on the DNS latency for a specific website the user is trying to visit, detects if there's an increase in latency, and set the bandwidth
and rtt
before the user loads other web assets (i.e. html, css, js, images, etc.).
Also another thing that some of our users noticed was CAKE is sometimes causing ping spikes when bandwidth
is set to a fixed value. According to the man7 page SHAPER PARAMETERS, "It will automatically burst precisely as much as required to maintain the configured throughput." so I guess that "burst" is causing the ping spikes?
Setting the shaper to unlimited
did solve the ping spike issue according to what our users said, but I believe it won't give the full benefits of CAKE, especially the shaper, no?
Some of our users said that the ping spike issue is kind of solved when bandwidth
and rtt
parameters are set dynamically. I believe setting the rtt
value based on the real RTT for every DNS request also helps make the AQM responds better to latency instead of using a fixed value.
The problem is, there's no way for CAKE to know that kind of information unless we provide it from somewhere, in real-time. Thus, the easiest way to get the user's RTT at that exact time is from making the DNS server that's running locally on the user's machine giving the latency information to CAKE, since DNS latency will vary depending on what website the user is trying to visit at that time.
I hope anyone who's familiar with Go, and has the time to try it, can give feedbacks if this implementation is helpful, and perhaps also review the logic from the code, if there's anything need to be adjusted for achieving better results but still keeping it simple for the general users.