From 2de1f3eed957f5800bd261ed065c0b6a1100e8b8 Mon Sep 17 00:00:00 2001 From: Matthias Wirth Date: Thu, 14 Mar 2024 13:59:06 +0100 Subject: [PATCH 1/3] increase beast-reduce flush interval --- README.md | 5 +++-- rootfs/etc/s6-overlay/scripts/readsb | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2279878..95b8aab 100644 --- a/README.md +++ b/README.md @@ -367,8 +367,9 @@ There are many optional parameters relating to the ingestion of data and the gen | `READSB_NET_BEAST_INPUT_PORT` | TCP Beast input listen ports | `--net-bi-port=` | `30004,30104` | | `READSB_NET_BEAST_OUTPUT_PORT` | TCP Beast output listen ports | `--net-bo-port=` | `30005` | | `READSB_NET_BUFFER` | TCP buffer size 64Kb \* (2^n) | `--net-buffer=` | `2` (256Kb) | -| `READSB_NET_RAW_OUTPUT_INTERVAL` | TCP output flush interval in seconds (maximum interval between two network writes of accumulated data). | `--net-ro-interval=` | `0.05` | -| `READSB_NET_RAW_OUTPUT_SIZE` | TCP output flush size (maximum amount of internally buffered data before writing to network). | `--net-ro-size=` | `1200` | +| `READSB_NET_RAW_OUTPUT_INTERVAL` | TCP output flush interval in seconds (maximum output buffer delay). | `--net-ro-interval=` | `0.05` | +| `READSB_NET_RO_INTERVAL_BEAST_REDUCE` | TCP output flush interval in seconds for beast reduce outputs (maximum output buffer delay). | `--net-ro-interval-beast-reduce= | `0.12` | +| `READSB_NET_RAW_OUTPUT_SIZE` | TCP output flush size (maximum amount of internally buffered data before writing to network). | `--net-ro-size=` | `1280` | | `READSB_NET_CONNECTOR_DELAY` | Outbound re-connection delay. | `--net-connector-delay=` | `30` | | `READSB_NET_HEARTBEAT` | TCP heartbeat rate in seconds (0 to disable). | `--net-heartbeat=` | `35` | | `READSB_NET_RAW_INPUT_PORT` | TCP raw input listen ports. | `--net-ri-port=` | `30001` | diff --git a/rootfs/etc/s6-overlay/scripts/readsb b/rootfs/etc/s6-overlay/scripts/readsb index d8e31b9..237f6f4 100755 --- a/rootfs/etc/s6-overlay/scripts/readsb +++ b/rootfs/etc/s6-overlay/scripts/readsb @@ -207,6 +207,11 @@ if [[ -n "$READSB_NET_RAW_OUTPUT_INTERVAL" ]]; then READSB_CMD+=("--net-ro-interval=$READSB_NET_RAW_OUTPUT_INTERVAL") fi +# use 0.12s/120ms to reduce number of packets sent to aggregators (compared to ro-interval 50ms) +# most aggregator feed clients historically use 200ms so this is already a reduction in jitter / latency +READSB_CMD+=("--net-ro-interval-beast-reduce=${READSB_NET_RO_INTERVAL_BEAST_REDUCE:-0.12}") + + # Handle "--net-ri-port=" if [[ -n "$READSB_NET_RAW_OUTPUT_PORT" ]]; then READSB_CMD+=("--net-ro-port=$READSB_NET_RAW_OUTPUT_PORT") From 9221009a565a3989de3e19e450b53200fc42ea20 Mon Sep 17 00:00:00 2001 From: Matthias Wirth Date: Thu, 14 Mar 2024 14:07:04 +0100 Subject: [PATCH 2/3] use beast_out instead of beast_reduce_out for mlat results --- rootfs/etc/s6-overlay/scripts/mlathub | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rootfs/etc/s6-overlay/scripts/mlathub b/rootfs/etc/s6-overlay/scripts/mlathub index 4fbed2c..47ca43b 100755 --- a/rootfs/etc/s6-overlay/scripts/mlathub +++ b/rootfs/etc/s6-overlay/scripts/mlathub @@ -27,7 +27,7 @@ MLATHUB_CMD+=("--mlat") MLATHUB_CMD+=("--forward-mlat") MLATHUB_CMD+=("--forward-mlat-sbs") -MLATHUB_CMD+=("--net-connector=localhost,30004,beast_reduce_out") +MLATHUB_CMD+=("--net-connector=localhost,30004,beast_out") # define some more ports: MLATHUB_CMD+=("--net-sbs-port=${MLATHUB_SBS_OUT_PORT:-31003}") From 6f6587f8a6d5f99fc234f9bccf9411aa6a7b12fc Mon Sep 17 00:00:00 2001 From: Matthias Wirth Date: Thu, 14 Mar 2024 14:11:52 +0100 Subject: [PATCH 3/3] allow user to customise mlat-client startup stagger delay --- README.md | 1 + rootfs/etc/s6-overlay/scripts/mlat-client | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 95b8aab..7e3cbf8 100644 --- a/README.md +++ b/README.md @@ -203,6 +203,7 @@ The following parameters must be set (mandatory) for the container to function: | `READSB_EXTRA_ARGS` | Optional, allows to specify extra parameters for readsb | | Unset | | `S6_SERVICES_GRACETIME` | Optional, set to 30000 when saving traces / globe_history | | `3000` | | `LOGLEVEL` | `verbose` (all messages), `error` (errors only), `none` (minimal) | | `verbose` | +| `MLAT_STARTUP_STAGGER` | mlat-client startup staggering for tidy logs (reduce for quicker startup) | | `15` | `READSB_EXTRA_ARGS` just passes arguments to the commandline, you can check this file for more options for wiedehopf's readsb fork: diff --git a/rootfs/etc/s6-overlay/scripts/mlat-client b/rootfs/etc/s6-overlay/scripts/mlat-client index 79a4c52..96ae611 100755 --- a/rootfs/etc/s6-overlay/scripts/mlat-client +++ b/rootfs/etc/s6-overlay/scripts/mlat-client @@ -205,7 +205,7 @@ do # stagger by 15 second so they don't all start at the same time - sleep 15 & wait $! + sleep "${MLAT_STARTUP_STAGGER:-15}" & wait $! # ------------------------------------------------ # run this Mlat_client instance in the background: