Skip to main content

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

Release files for fastest-pkg 0.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fastest-pkg 0.2.3
File Size Uploaded
fastest_pkg-0.2.3.tar.gz 5.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fastest-pkg 0.2.3
File Interpreter ABI Platform
fastest_pkg-0.2.3-py3-none-any.whl Python 3 none any Details

Total release size: 12.3 kB

Release files / fastest_pkg-0.2.3.tar.gz

Download URL fastest_pkg-0.2.3.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
d110a8a773153fe78282b492c3d841c6f06ce14e7dbc184b62ae2b65b3ecad6b
BLAKE2b-256 checksum
How to use checksums
93ad8af8fbbd29931450fb35281d7cbd32f5183e3fcb2b8a32fde8e665adc5dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.23

Release files / fastest_pkg-0.2.3-py3-none-any.whl

Download URL fastest_pkg-0.2.3-py3-none-any.whl
Size 6.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
569b7f936a76ccddfd755338eea0b4fb45ecc9bea88a638aaa27e7167f9f0aef
BLAKE2b-256 checksum
How to use checksums
f4c5fd0f407b397052b23e752bde2aad613cec1eede0ac46f6c511c0fdb5dfe7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.23

Release history Release notifications | RSS feed

This release

0.2.3 This release

2 release files

0.2.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page