Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastest_pkg-0.2.3.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastest_pkg-0.2.3-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

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

Hashes for fastest_pkg-0.2.3.tar.gz
Algorithm Hash digest
SHA256 d110a8a773153fe78282b492c3d841c6f06ce14e7dbc184b62ae2b65b3ecad6b
MD5 7a0ddb3cfb5adb88c9fcf8aff46c4041
BLAKE2b-256 93ad8af8fbbd29931450fb35281d7cbd32f5183e3fcb2b8a32fde8e665adc5dc

See more details on using hashes here.

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

Hashes for fastest_pkg-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 569b7f936a76ccddfd755338eea0b4fb45ecc9bea88a638aaa27e7167f9f0aef
MD5 7c5acf7b0128236f6636d2c96a2dccc9
BLAKE2b-256 f4c5fd0f407b397052b23e752bde2aad613cec1eede0ac46f6c511c0fdb5dfe7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page