Skip to content

Latest commit

 

History

History
96 lines (65 loc) · 3.07 KB

ANALYSIS.md

File metadata and controls

96 lines (65 loc) · 3.07 KB

Analyzing cake-autorate data

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.

Viewing a simple summary of key statistics on the command line

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

Logging options for a more detailed analysis

Enabling output_processing_stats and output_load_stats is recommended for any detailed analysis and indeed necessary for either plotting tool described below.

Exporting a Log File

Extract a compressed log file from a running cake-autorate instance using one of these methods:

  1. Run the auto-generated log_file_export script inside the run directory:

    /var/run/cake-autorate/*/log_file_export

    ... or ...

  2. 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.

Resetting the Log File

Force a log file reset on a running cake-autorate instance by using one of these methods:

  1. Run the auto-generated log_file_rotate script inside the run directory:

    /var/run/cake-autorate/*/log_file_reset

    ... or ...

  2. 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

Plotting the Log File

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 root@192.168.1.1 '/var/run/cake-autorate/primary/log_file_export 1>/dev/null && cat /var/run/cake-autorate/primary/last_log_file_export') && scp -O root@192.168.1.1:${log_file} . && ssh root@192.168.1.1 "rm ${log_file}"
octave -qf --eval 'fn_parse_autorate_log("./*primary*log.gz", "./output.png")'

Prometheus cake-autorate exporter

Check out bairhys' prometheus-cake-autorate-exporter for beautiful, continuous plotting of cake-autorate statistics: