Script to find the fastest FreeBSD.org pkg mirror
Project description
fastest_pkg
Synopsis
Script to find the fastest FreeBSD.org pkg mirror near you.
Description
By default FreeBSD pkg uses DNS-based load balancing. This is achieved through an SRV query:
$ dig +short _http._tcp.pkg.all.freebsd.org srv
50 10 80 pkg0.bbt.freebsd.org.
50 10 80 pkg0.bme.freebsd.org.
50 10 80 pkg0.bra.freebsd.org.
50 10 80 pkg0.fra.freebsd.org.
50 10 80 pkg0.isc.freebsd.org.
50 10 80 pkg0.kul.freebsd.org.
50 10 80 pkg0.kwc.freebsd.org.
50 10 80 pkg0.nyi.freebsd.org.
50 10 80 pkg0.tuk.freebsd.org.
50 10 80 pkg0.twn.freebsd.org.
50 10 80 pkg0.jinx.freebsd.org.
However, this method will try to choose the nearest mirror, which will not necessarily be the fastest. This script can help you to find the fastest pkg mirror by trying each one in succession. At the end of the output you'll see a sample configuration to hardcode the fastest pkg mirror leading to much higher pkg performance.
$ fastest_pkg
pkg0.bbt.freebsd.org: 587.7 kB/s
pkg0.bme.freebsd.org: 13.9 MB/s
pkg0.bra.freebsd.org: 1.4 MB/s
pkg0.fra.freebsd.org: 14.3 MB/s
pkg0.isc.freebsd.org: 0.0 B/s
pkg0.kul.freebsd.org: 1.9 MB/s
pkg0.kwc.freebsd.org: 1.5 MB/s
pkg0.nyi.freebsd.org: 4.0 MB/s
pkg0.tuk.freebsd.org: 2.6 MB/s
pkg0.twn.freebsd.org: 1.8 MB/s
pkg0.jinx.freebsd.org: 1.8 MB/s
Fastest:
pkg0.fra.freebsd.org: 14.3 MB/s
Write configuration:
mkdir -p /usr/local/etc/pkg/repos/
echo 'FreeBSD: { url: "http://pkg0.fra.freebsd.org/${ABI}/latest", mirror_type: "NONE" }' \
> /usr/local/etc/pkg/repos/FreeBSD.conf
The following cli options are available:
$ fastest_pkg --help
usage: fastest_pkg [-h] [-j] [-v] [-t TIMEOUT]
Script for finding and configuring fastest FreeBSD pkg mirror
optional arguments:
-h, --help show this help message and exit
-j, --json only show basic information in JSON format
-v, --verbose be more verbose
-t TIMEOUT, --timeout TIMEOUT
timeout in ms
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fastest_pkg-0.2.3.tar.gz.
File metadata
- Download URL: fastest_pkg-0.2.3.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d110a8a773153fe78282b492c3d841c6f06ce14e7dbc184b62ae2b65b3ecad6b
|
|
| MD5 |
7a0ddb3cfb5adb88c9fcf8aff46c4041
|
|
| BLAKE2b-256 |
93ad8af8fbbd29931450fb35281d7cbd32f5183e3fcb2b8a32fde8e665adc5dc
|
File details
Details for the file fastest_pkg-0.2.3-py3-none-any.whl.
File metadata
- Download URL: fastest_pkg-0.2.3-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
569b7f936a76ccddfd755338eea0b4fb45ecc9bea88a638aaa27e7167f9f0aef
|
|
| MD5 |
7c5acf7b0128236f6636d2c96a2dccc9
|
|
| BLAKE2b-256 |
f4c5fd0f407b397052b23e752bde2aad613cec1eede0ac46f6c511c0fdb5dfe7
|