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 a SRV query:

$ dig +short _http._tcp.pkg.freebsd.org srv
10 10 80 pkgmir.geo.freebsd.org.
50 10 80 pkg0.bme.freebsd.org.
50 10 80 pkg0.isc.freebsd.org.
50 10 80 pkg0.nyi.freebsd.org.
50 10 80 pkg0.pkt.freebsd.org.
50 10 80 pkg0.tuk.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.py 
pkg0.tuk.freebsd.org: 2.4 MB/s
pkg0.twn.freebsd.org: 16.8 MB/s
pkg0.bbt.freebsd.org: 7.7 MB/s
pkg0.bme.freebsd.org: 1.6 MB/s
pkg0.bra.freebsd.org: 68.2 kB/s
pkg0.isc.freebsd.org: 0.0 B/s
pkg0.jinx.freebsd.org: 65.6 kB/s
pkg0.kul.freebsd.org: 7.8 MB/s
pkg0.kwc.freebsd.org: 8.7 MB/s
pkg0.pkt.freebsd.org: 1.7 MB/s
pkg0.nyi.freebsd.org: 1.6 MB/s

Fastest:
pkg0.twn.freebsd.org: 16.8 MB/s


Write configuration:
mkdir -p /usr/local/etc/pkg/repos/
echo 'FreeBSD: { url: "http://pkg0.twn.freebsd.org/${ABI}/quarterly" }' \
        > /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.1.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file fastest_pkg-0.2.1.tar.gz.

File metadata

  • Download URL: fastest_pkg-0.2.1.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for fastest_pkg-0.2.1.tar.gz
Algorithm Hash digest
SHA256 0a0efa68d3f97316721ce439fe5b403248c18cadb4de20e37bfc3df3b180cbaa
MD5 af4829b953517c166180e7d35833e37a
BLAKE2b-256 14cbc527c45614681f8f3e2436d4b385da3025b51b8858a03494c65f389926af

See more details on using hashes here.

File details

Details for the file fastest_pkg-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: fastest_pkg-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for fastest_pkg-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c9d06b14e247db86a611a5d848f94d5cad02c9afcea3dd0ae9fbca5717de2dc9
MD5 a10cb2c7bb77743ace0017ba56a215b7
BLAKE2b-256 8fc76250eec7d1e2285db413ca50a9ad6bef7330b78f0cf7d6f8738e3e7bf4a4

See more details on using hashes here.

Supported by

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