speedketchup

SpeedKetchup

Run periodic internet speed test, store, display results with builtin web server.


Introduction

This aims to be small, efficient all-in-one program (statically linked, includes web assets) written in rust. The intent is to allow monitoring of your internet connection as easy as possible. You can use speedketchup for one-off test or keep it running continuously to spot any changes in your internet connection.

Prebuilt executables for some platforms: | platform | executable | upx-compressed executable | |-|-|-| |linux x86_64|452k|197k| |linux i686|451k|202k| |linux aarch64|460k|189k| |linux arm|451k|196k| |linux mips|592k|224k| |linux mipsel|592k|227k| |windows x86_64|431k|182k| |macos universal (x86_64 + aarch64)|682k|

Builtin web server

speedketchup webserver

Features

Command Line

usage: speedketchup [options]
	-h|--help: print this
	-v|--version: print version
	-i|--interval &ltminutes&gt: test interval in minutes, 10 by default
	-f|--file &ltfilename&gt: file to store test results in, speedketchup-results.csv by default
	-a|--address &ltlocal_addr&gt: address to listen on for incoming connections, 127.0.0.1 by default
		local_addr: use 0.0.0.0 to accept connections on all addresses
	-p|--port &ltport&gt: port to listen on for incoming connections, 8080 by default
	-s|--server &ltserver_host[:server_port]&gt: speedtest server to use, avoids automatic server selection if specified
		server_host: domain_name|ipv4_addr|ipv6_addr
		server_port: port number, 8080 by default
	-dd|--download-duration &ltseconds&gt: how long to test download speed, 0 disables test, 10 seconds by default
	-ud|--upload-duration &ltseconds&gt: how long to test upload speed, 0 disables test, 10 seconds by default
	-dc|--download-connections &ltnumber&gt: how many parallel connections to make for download, 8 connections by default
	-uc|--uplaod-connections &ltnumber&gt: how many parallel connections to make for upload, 8 connections by default

every option can also be given as an environment variable, command line options
take precedence:
	SPEEDKETCHUP_INTERVAL, SPEEDKETCHUP_FILE, SPEEDKETCHUP_ADDRESS,
	SPEEDKETCHUP_PORT, SPEEDKETCHUP_SERVER, SPEEDKETCHUP_DOWNLOAD_DURATION,
	SPEEDKETCHUP_UPLOAD_DURATION, SPEEDKETCHUP_DOWNLOAD_CONNECTIONS,
	SPEEDKETCHUP_UPLOAD_CONNECTIONS

Building

A plain make gives you a binary for the machine you are on.

The release binaries are smaller than that: they are built on a pinned rust nightly with -Z build-std, -Zlocation-detail=none and -Cpanic=immediate-abort, which rebuilds the standard library without the panic formatting machinery.

make release   # every released binary, needs a mac
make macos     # just the macos universal binary
make linux     # just the linux + windows binaries

The linux and windows binaries are cross built inside the container image in build/Dockerfile - make linux builds that image and re-enters make inside it, so the only thing needed on the host is container on macos, or CONTAINER=docker (or podman) anywhere else. The image carries the cross toolchains, a musl built for the tier 3 mips targets, upx and qemu-user - every binary is run once before the build is considered done. Everything lands in ./bin.

Container

Official container image: gatispei/speedketchup on Docker Hub.

The image is FROM scratch: one layer holding the statically linked binary and an empty /data for the results volume, nothing else. No shell, no libc, no base image underneath. Built for linux/amd64, linux/386, linux/arm64 and linux/arm/v6.

make image

That cross builds the binaries and assembles the manifest with the same container runtime as the rest of the build. With docker, point it at buildx: make image IMAGE_BUILD="docker buildx build".

docker volume create speedketchup
docker run -p 8080:8080 -v speedketchup:/data gatispei/speedketchup

Alternatives