You are not logged in.

#1 2017-04-16 16:20:59

daanjderuiter
Member
Registered: 2016-12-28
Posts: 44

[Solved] Pacman updates very slow despite solid network

I recently purchased a new router, and was surprised to find that pacman downloads had become terribly slow; ~200kB/s. The router is connected to the gigabit network of my uni campus, and I was always used to having downloads in the tens of MB's per second. All other traffic behaves fine; speedtest still indicates correct speeds, and other devices on my network behave normally. I also tested Arch in a live session to see if it is some Arch-specific problem or something of the like, but that worked just fine, and had an identical resolv.conf file. I tried the router both with stock firmware and OpenWRT; both show similar behaviour.
Has anyone had similar experiences, or some valuable advice? Maybe some conflicting networking utilities?

Last edited by daanjderuiter (2017-04-18 14:50:46)

Offline

#2 2017-04-16 17:32:09

watersalesman
Member
Registered: 2017-04-16
Posts: 3

Re: [Solved] Pacman updates very slow despite solid network

If your connection is not the issue, it might be the mirrors that pacman is using to download the packages. Try sorting the mirrors by speed, or at least by region. These are located in /etc/pacman.d/mirrorlist. The link below has information on how to go about sorting these.

https://wiki.archlinux.org/index.php/mi … ng_mirrors

Offline

#3 2017-04-16 18:16:14

daanjderuiter
Member
Registered: 2016-12-28
Posts: 44

Re: [Solved] Pacman updates very slow despite solid network

I've already tried refreshing my mirrorlist using rankmirrors using the mirrorlist in /etc/pacman.d/, to no avail. I just tried running rankmirrors against the complete list of mirrors on the wiki, but the result is still the same. It's not that surprising; the old mirrorlist worked just fine on other networks.
EDIT: even cherrypicking mirrors does not work; I tried putting a server that is being hosted on my university's campus on top in my mirrorfile, but the downloads are still very slow

Last edited by daanjderuiter (2017-04-16 19:04:21)

Offline

#4 2017-04-16 19:19:10

daanjderuiter
Member
Registered: 2016-12-28
Posts: 44

Re: [Solved] Pacman updates very slow despite solid network

Extra fun fact: I just got all excited after fiddling around with this issue, rebooting and seeing that my first download was going smooth, only to find my download speeds to be very low again a moment later. Still do not have the slightest clue.

Offline

#5 2017-04-16 19:28:30

watersalesman
Member
Registered: 2017-04-16
Posts: 3

Re: [Solved] Pacman updates very slow despite solid network

Hmmm that's strange. Try using nethogs to see if there is a process, such as a startup service, eating up obscene amounts of bandwidth.

And if it works just fine on the live environment, it might be worth triple checking that the mirrorlist is the same and the same network driver is being loaded (check with "lspci -v") as your install.

Last edited by watersalesman (2017-04-17 01:32:54)

Offline

#6 2017-04-16 20:59:15

daanjderuiter
Member
Registered: 2016-12-28
Posts: 44

Re: [Solved] Pacman updates very slow despite solid network

There were no processes hogging up bandwidth, but I did discover the problem; pacman is for some reason downloading over WiFi instead of ethernet, while all other processes use ethernet. Since it defaults to the shitty access points in the dorm to which I have bad connectivity, this was painfully slow. I have absolutely no clue why pacman would do this. Disabling WiFi yields fast downloads. Not a clue why this would happen, though.

Last edited by daanjderuiter (2017-04-16 21:00:06)

Offline

#7 2017-04-17 01:38:24

watersalesman
Member
Registered: 2017-04-16
Posts: 3

Re: [Solved] Pacman updates very slow despite solid network

Sounds like a default behavior on the software you are using to manage your networking -- e.g. networkmanager. Glad you got it figured out though. You should mark this as solved if all is well.

Offline

#8 2017-04-17 08:22:17

daanjderuiter
Member
Registered: 2016-12-28
Posts: 44

Re: [Solved] Pacman updates very slow despite solid network

Not quite - my NetworkManager.conf is surprisingly empty, as are most of my networking configs and pacman.conf. I want to find the source to this, then I'll post that and mark this as solved

Offline

#9 2017-04-17 09:41:56

loqs
Member
Registered: 2014-03-06
Posts: 17,369

Re: [Solved] Pacman updates very slow despite solid network

Adding the --debug option to pacman should give you the url and download agent used then you can try using the download agent directly.
Do both interfaces have IPV4 and IPV6 addresses?

Offline

#10 2017-04-17 11:14:16

daanjderuiter
Member
Registered: 2016-12-28
Posts: 44

Re: [Solved] Pacman updates very slow despite solid network

I cannot seem to find my download agent in the debug output. looked for keywords like agent, download, network, interface, iface, wlp5s0 (name of my wireless adapter) etc. No mention of anything related to downloading interfaces around the downloading-part of the output, either. Any ideas?

Last edited by daanjderuiter (2017-04-17 11:16:21)

Offline

#11 2017-04-17 11:37:30

loqs
Member
Registered: 2014-03-06
Posts: 17,369

Re: [Solved] Pacman updates very slow despite solid network

Ah sorry forgot it would not be displayed if no packages were downloaded and I agree it is not obvious.

debug: curl returned error 0 from transfer

Easier to check /etc/pacman.conf if no XferCommand is uncommented the default should be the commented curl line

#XferCommand = /usr/bin/curl -C - -f %u > %o
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u

Offline

#12 2017-04-18 14:49:43

daanjderuiter
Member
Registered: 2016-12-28
Posts: 44

Re: [Solved] Pacman updates very slow despite solid network

Since I was unable to pinpoint why pacman decided to use my wireless over ethernet, and encountered a few other programs that exhibited similar behaviour, I opted for a not-so-subtle workaround that simply turns off my wifi-radio when ethernet is connected:

$ cat /etc/NetworkManager/dispatcher.d/99-wlan
#!/bin/sh

if [ "$1" = "enp4s0" ]; then
    case "$2" in
        up)
            nmcli radio wifi off
            ;;
        down)
            nmcli radio wifi on
            ;;
    esac
fi

If someone has a solution that actually prevents processes from using wifi instead of disabling the option of wifi altogether, I'd be glad to hear it, but for now this'll do.

Offline

#13 2017-04-18 15:03:57

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: [Solved] Pacman updates very slow despite solid network

The only thing I can think of is you have a "special" routing table, typically ethernet routes will have a lower metric than wireless ones, which means ethernet will be used unless you have some route that goes only over wireless.

I'm not a networking expert though so share your routing table after you follow the steps that lead to the problem and maybe someone will spot a problem.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#14 2017-04-18 16:19:50

daanjderuiter
Member
Registered: 2016-12-28
Posts: 44

Re: [Solved] Pacman updates very slow despite solid network

I am not too intent to show all the lovely people of the internet where I live, so I masked out the (public) IP of the wireless AP:

$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG    202    0        0 enp4s0
0.0.0.0         x.x.x.1         0.0.0.0         UG    600    0        0 wlp5s0
x.x.x.0         0.0.0.0         255.255.248.0   U     600    0        0 wlp5s0
192.168.1.0     0.0.0.0         255.255.255.0   U     202    0        0 enp4s0

So yes, lower metric for ethernet routes

Last edited by daanjderuiter (2017-04-19 09:08:38)

Offline

#15 2017-04-18 18:55:05

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: [Solved] Pacman updates very slow despite solid network

Routing table looks ok to me, but like I said before, I'm not an expert on networking.

Regarding masking your wireless AP IP address, if it is not a public IP I don't see what you have to lose, and even if you have configured a less common private address range you do use wpa2 right?


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#16 2017-04-20 15:32:22

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,919

Re: [Solved] Pacman updates very slow despite solid network

Your routing table shows 2 routes with destination 0.0.0.0 netmask 0.0.0.0 aka default route.

Any network should only have one default route.


Basically your network devices are connected to 2 different networks, each with their own default route and gateway.

To make that work correctly you would need to configure your system as  a router.


A new thread where you start with explaining what you want to achieve by using 2 different networks is probably best for that.

Last edited by Lone_Wolf (2017-04-20 15:33:53)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

Board footer

Powered by FluxBB