Hello everyone,
I am hosting a few Tor relays on FreeBSD VMs and have recently ran into issues with installing updates via pkg on hosts with high network usage.
I have tried forcing pkg to use IPv4 or IPv6, but neither changed anything.
The hosts currently still run FreeBSD 14.3-RELEASE-p15, but will be upgraded to 15.1-RELEASE as soon as it's available.
They all have 2 GB of RAM and 4 GB of Swap configured and the network allows up to 1.000 Mbit/s of traffic.
The firewall used is pf, but the rule
The host where it happens basically always has about 200 Mbit/s of traffic, with ~30.000 packets per second and about 15.000 tcp states in pf.
DNS is working also, even while under load:
The top command reports the following load:
The vmstat command reports the following:
When running pkg update, I get the following output:
Weirdly enough, connections over SSH and SFTP are not affected.
When uploading or downloading files, I get round 25 MB/s or 200 Mbit/s, so it's not a bandwidth problem.
As soon as I stop the Tor process, pkg will work normally again.
This however is not a viable solution, as pkg is supposed to be automatically updating itself via Cron.
Is there something I could check to find out why pkg is stalling?
I am hosting a few Tor relays on FreeBSD VMs and have recently ran into issues with installing updates via pkg on hosts with high network usage.
I have tried forcing pkg to use IPv4 or IPv6, but neither changed anything.
The hosts currently still run FreeBSD 14.3-RELEASE-p15, but will be upgraded to 15.1-RELEASE as soon as it's available.
They all have 2 GB of RAM and 4 GB of Swap configured and the network allows up to 1.000 Mbit/s of traffic.
The firewall used is pf, but the rule
pass out quick keep state allows all outgoing traffic.The host where it happens basically always has about 200 Mbit/s of traffic, with ~30.000 packets per second and about 15.000 tcp states in pf.
DNS is working also, even while under load:
Code:
% host pkg.freebsd.org
pkg.freebsd.org is an alias for pkgmir.geo.freebsd.org.
pkgmir.geo.freebsd.org has address 151.101.193.241
pkgmir.geo.freebsd.org has address 151.101.1.241
pkgmir.geo.freebsd.org has address 151.101.129.241
pkgmir.geo.freebsd.org has address 151.101.65.241
pkgmir.geo.freebsd.org has IPv6 address 2a04:4e42:400::497
pkgmir.geo.freebsd.org has IPv6 address 2a04:4e42:200::497
pkgmir.geo.freebsd.org has IPv6 address 2a04:4e42::497
pkgmir.geo.freebsd.org has IPv6 address 2a04:4e42:600::497
pkgmir.geo.freebsd.org mail is handled by 0 .
The top command reports the following load:
Code:
CPU: 21.9% user, 0.0% nice, 12.5% system, 6.3% interrupt, 59.4% idle
Mem: 681M Active, 812M Inact, 41M Laundry, 384M Wired, 154M Buf, 45M Free
Swap: 4096M Total, 2828K Used, 4093M Free
The vmstat command reports the following:
Code:
procs memory page disks faults cpu
r b w avm fre flt re pi po fr sr vtb0 in sy cs us sy id
0 0 0 2.4G 44M 78 27 0 0 95 340 0 6.9k 268k 23k 17 16 66
2 0 0 2.4G 44M 1 0 0 0 0 280 0 6.2k 449k 21k 16 19 63
0 0 0 2.4G 44M 7 0 0 0 0 280 0 4.3k 410k 16k 19 16 64
1 0 0 2.4G 44M 6 0 0 0 8 280 7 5.7k 381k 19k 20 17 61
0 0 0 2.4G 44M 1 0 0 0 0 280 0 5.0k 431k 18k 19 21 58
1 0 0 2.4G 44M 0 0 0 0 0 280 2 5.5k 441k 18k 19 25 54
1 0 0 2.4G 44M 7 0 0 0 0 280 0 6.7k 425k 22k 19 25 55
0 0 0 2.4G 44M 14 0 0 0 0 280 0 6.7k 390k 23k 18 16 65
0 0 0 2.4G 44M 8 0 0 0 0 308 0 6.7k 409k 23k 17 14 67
1 0 0 2.4G 44M 5 0 0 0 0 280 0 6.6k 411k 22k 20 19 59
1 0 0 2.4G 44M 12 0 0 0 0 280 0 6.8k 426k 23k 22 22 55
When running pkg update, I get the following output:
Code:
Updating FreeBSD repository catalogue...
Fetching data: 0% 16 KiB 16.0 kB/s 05:59:27 ETA
pkg: An error occurred while fetching package
pkg: https://pkgmir.geo.freebsd.org/FreeBSD:14:amd64/latest/data.tzst: Not Found
Fetching packagesite: 0% 64 KiB 65.1 kB/s 01:27:35 ETA
pkg: An error occurred while fetching package
pkg: https://pkgmir.geo.freebsd.org/FreeBSD:14:amd64/latest/packagesite.tzst: Not Found
Unable to update repository FreeBSD
Updating FreeBSD-kmods repository catalogue...
FreeBSD-kmods repository is up to date.
Error updating repositories!
Checking for upgrades (1 candidates): 100% 1 B 0.0 kB/s 00:01
Processing candidates (1 candidates): 100% 1 B 0.0 kB/s 00:01
Checking integrity... done (0 conflicting)
Your packages are up to date.
Weirdly enough, connections over SSH and SFTP are not affected.
When uploading or downloading files, I get round 25 MB/s or 200 Mbit/s, so it's not a bandwidth problem.
As soon as I stop the Tor process, pkg will work normally again.
This however is not a viable solution, as pkg is supposed to be automatically updating itself via Cron.
Is there something I could check to find out why pkg is stalling?