cake-autorate is a script that minimizes latency by adjusting CAKE bandwidth settings based on traffic load and round-trip time measurements. See the main README page for more details of the algorithm.
A simple summary of the key statistics can be generated on the command
line so long as output_reflector_stats
is enabled using e.g.:
tail -f /var/log/cake-autorate.primary.log | grep -e SUMMARY
Enabling output_processing_stats
and output_load_stats
is
recommended for any detailed analysis and indeed necessary for either
plotting tool described below.
Extract a compressed log file from a running cake-autorate instance using one of these methods:
-
Run the auto-generated log_file_export script inside the run directory:
/var/run/cake-autorate/*/log_file_export
... or ...
-
Send a USR1 signal to the main log file process(es) using:
awk -F= '/^maintain_log_file=/ {print $2}' /var/run/cake-autorate/*/proc_pids | xargs kill -USR1
Either will place a compressed log file in /var/log with the date and time in its filename.
Force a log file reset on a running cake-autorate instance by using one of these methods:
-
Run the auto-generated log_file_rotate script inside the run directory:
/var/run/cake-autorate/*/log_file_reset
... or ...
-
Send a USR2 signal to the main log file process(es) using:
awk -F= '/^maintain_log_file=/ {print $2}' /var/run/cake-autorate/*/proc_pids | xargs kill -USR2
The excellent Octave/Matlab program fn_parse_autorate_log.m by @moeller0 of OpenWrt can read an exported log file and produce a helpful graph like this:
The command below will run the Octave program (see the introductory notes in fn_parse_autorate_log.m for more details):
octave -qf --eval 'fn_parse_autorate_log("./log.gz", "./output.png")'
The script below can be run on a remote machine to extract the log from the router and generate the pdfs for viewing from the remote machine:
log_file=$(ssh [email protected] '/var/run/cake-autorate/primary/log_file_export 1>/dev/null && cat /var/run/cake-autorate/primary/last_log_file_export') && scp -O [email protected]:${log_file} . && ssh [email protected] "rm ${log_file}"
octave -qf --eval 'fn_parse_autorate_log("./*primary*log.gz", "./output.png")'
Check out bairhys' prometheus-cake-autorate-exporter for beautiful, continuous plotting of cake-autorate statistics: