From 7edf85718b2f8cff69b373cb19324f22c771df0d Mon Sep 17 00:00:00 2001 From: Amir Date: Mon, 29 Dec 2025 14:52:46 -0300 Subject: [PATCH] docs: update speedtest setup instructions for native engine --- front/plugins/internet_speedtest/README.md | 28 +++++++++++++++------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/front/plugins/internet_speedtest/README.md b/front/plugins/internet_speedtest/README.md index 9fab1136..933d2f07 100755 --- a/front/plugins/internet_speedtest/README.md +++ b/front/plugins/internet_speedtest/README.md @@ -6,20 +6,30 @@ A plugin allowing for executing regular internet speed tests. This plugin supports two engines: 1. **Baseline Engine**: Uses the Python `speedtest-cli` library (default). -2. **Native Engine (Optimized)**: Uses the native Ookla Speedtest binary. +2. **Native Engine (Optimized)**: Uses the official native Ookla Speedtest binary. #### Opt-in for Native Engine -To use the native engine: -- Provide the native `speedtest` binary in your environment: [Speedtest CLI Homepage](https://www.speedtest.net/apps/cli) -- Map the binary to `/usr/bin/speedtest` in the container. -- **Ensure the native speedtest binary is installed on the host at the source path.** +To use the native engine, you must provide the official binary to the container. The native binary is **strongly recommended** for internet connections > 100 Mbps to ensure CPU bottlenecks don't affect your results. + +**Setup Instructions:** +1. **Download:** Get the official binary for your architecture from the [Speedtest CLI Homepage](https://www.speedtest.net/apps/cli). +2. **Place & Prepare:** Place the binary on your host machine (e.g., in `/opt/netalertx/`) and ensure it has executable permissions: + +```bash + chmod +x /opt/netalertx/speedtest +``` + +3. Docker Mapping: Map the host file to exactly `/usr/bin/speedtest` inside the container via your `docker-compose.yml`: ```yaml -volumes: - - /usr/bin/speedtest:/usr/bin/speedtest:ro +services: + netalertx: + volumes: + - /opt/netalertx/speedtest:/usr/bin/speedtest:ro ``` -- The plugin will automatically detect and use it for subsequent tests. +### Why this mapping? +Inside the container, a Python version of speedtest often exists in the virtual environment (`/opt/venv/bin/speedtest`). Mapping your native binary specifically to `/usr/bin/speedtest` allows the plugin to prioritize the high-performance native engine over the baseline library. ### Data Mapping @@ -30,4 +40,4 @@ volumes: ### Notes - The native binary is recommended for connections > 100 Mbps. -- If the native binary is not detected, the plugin seamlessly falls back to the baseline library. \ No newline at end of file +- If the native binary is not detected at /usr/bin/speedtest, or if it fails to execute, the plugin will seamlessly fall back to the baseline Python library. \ No newline at end of file