Pacman

Historical bug tracker for the Pacman package manager.

The pacman bug tracker has moved to gitlab:
https://gitlab.archlinux.org/pacman/pacman/-/issues

This tracker remains open for interaction with historical bugs during the transition period. Any new bugs reports will be closed without further action.
Tasklist

FS#17388 - pacman waits ~5 seconds after each download

Attached to Project: Pacman
Opened by Mark (markg85) - Saturday, 05 December 2009, 01:10 GMT
Last edited by Dan McGee (toofishes) - Saturday, 06 March 2010, 05:14 GMT
Task Type Bug Report
Category General
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version 3.3.3
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

In the last few days i installed archlinux twice and installing all of kde (pacman -S kde) took extremely long. Not because of my download speed (2 megabytes/second) but because pacman somehow has the urge to wait 5 seconds (just waiting.. no message or anything). Just a plain 5 second wait for any download. Few kilobytes.. wait. dozens of megabytes.. wait and when installing all of kde all that waiting adds up quite some time.

Side note. besides getting rid of this forced wait it might be handy to thread the downloads. So download 8 files simultain. I'm not talking about using 8 threads to download one file faster but again to download 8 files at the same time. The number 8 should be changeble in pacman.conf ^_^
This task depends upon

Closed by  Dan McGee (toofishes)
Saturday, 06 March 2010, 05:14 GMT
Reason for closing:  Not a bug
Additional comments about closing:  User config issue
Comment by Thomas Dziedzic (tomd123) - Saturday, 05 December 2009, 04:53 GMT
http://bbs.archlinux.org/viewtopic.php?id=75350

Please research beforehand or tell us what you have tried.
Comment by Allan McRae (Allan) - Saturday, 05 December 2009, 12:12 GMT
There is no forced wait. This is either to do with your mirror selection or some other part of your setup.
Comment by Mark (markg85) - Saturday, 05 December 2009, 16:00 GMT
i did do a small search in the manual and didn't find anything that might caused it.
And this used to be just fine with no delays some months ago when i installed another pc.. and now it's just slow.
And that is also the case when i install archlinux from the 2009.08 net image so it can't be part of my setup because that image is making my setup.

I also did select the best possible mirror for my location (the netherlands) to nluug (or surfnet or leaseweb) all with the same delay between file transfers.

sorry for not telling what i tried.. i simply forgot to mention it.
Comment by Mark (markg85) - Monday, 07 December 2009, 22:31 GMT
Now, a few days later i try to update my arch system.. and i still get the 5 seconds delay. I did NOT try the suggestion from the forum topic pasted by Tom because i wouldn't be able to do that when i install my system (net install) for the first time as well. Something is wrong here and i can't put my finger on it...

If we can't find a sane solution for this i'm willing to dig in the code and find this nasty issue. I would like a pointer to the file that is actually downloading packages.. (sync.c and sync.h?) and the actual line that is downloading..

but lets first just try to find the issue without diving in c code.
Comment by Robert Lewis (niriven) - Friday, 11 December 2009, 02:43 GMT
I have had this issue in the past also. This was definitally related to IPV6 for me.

Try the following:
1) Change your xfer command in /etc/pacman.conf to 'XferCommand = /usr/bin/wget -4 --passive-ftp -c -O %o %u'
2) Disable ipv6 in the kernel if you dont need it. in /etc/modprobe.d/modprobe.conf, add 'alias net-pf-10 off' and reboot

If either of these solve the problem, its IPV6 related. I always use 'alias net-pf-10 off' since i do not use IPV6, and it causes all sorts of delays in DNS lookups.

Please confirm or deny ...
Comment by Mark (markg85) - Tuesday, 29 December 2009, 13:36 GMT
Right now i have several hundreds of packages that need updating and i still had the (extremely irritating) 5 seconds delay after each download.
So, i tried : XferCommand = /usr/bin/wget -4 --passive-ftp -c -O %o %u as suggested. While it looks horrible it certainly is working without delays :)
I didn't try the ipv6 yet.

But since you said: "If either of these solve the problem, its IPV6 related." so i guess it's ipv6 related...
Does that mean that pacman is not working correctly when ipv6 is "installed"? Just for the record. this all just worked fine before. some update somewhere "broke" it but i have no clue which one because my system has roughly updated every package since the issue first happened.

@Robert Lewis: confirmed
Comment by Robert Lewis (niriven) - Tuesday, 29 December 2009, 14:54 GMT
I don't think this is a problem with pacman. If you do not disable or set up IPV6 properly, you will get delays related to DNS lookup, you will also see similar problems in other applications that can make use of of the IPV6 module.

I also noticed that something during an update changed the behavior of this on arch, but i am not sure what. I have just always followed these wiki instructions:

http://wiki.archlinux.org/index.php/IPv6_-_Disabling_the_Module

The wiki there mentions that 'Many don't require the features, and may benefit from added performance (many programs will query IPv6 addresses first, unaware that you don't have an IPv6 connection)'. My only guess on this one is that IPV6 enabled applications will 'timeout' when requesting traffic through IPV6, then revert to IPV4.
Comment by Mark (markg85) - Tuesday, 29 December 2009, 15:54 GMT
@Robert Lewis
I do hate to use this option to disable ipv6 but i guess i will have to if i don't want those damned 5 second waits!
I do feel like ipv6 is (or should be) the future and if an app is not working correctly it should simply be fixed. In this case You and I just don't know where the real issue is only that we can bypass it by disabling ipv6.

Perhaps the issue is in the downloading code of pacman? (didn't look t it)

Why can't the lookup stuff do ipv4 and ipv6 simultaneously and use the one that responds (drop the other one)..

Oh, just notice something. I used this mirror: ftp://ftp.surfnet.nl/pub/os/Linux/distr/archlinux/$repo/os/x86_64 which is always fast for me.
on this http://wiki.archlinux.org/index.php/Mirrors#IPv6-ready_mirrors page that mirror is marked as ipv6 ready! So, it should work! without delays!

Note: i tried a range of mirrors over the globe and all had the same issue.
Comment by Robert Lewis (niriven) - Tuesday, 29 December 2009, 16:01 GMT
Comment by Mark (markg85) - Tuesday, 29 December 2009, 16:46 GMT
Ehm, your message is empty. please repost.
Comment by Mark (markg85) - Tuesday, 29 December 2009, 19:41 GMT
Oh great.. ipv6 is disabled now like on that wiki page but i still have the 5 seconds delay in pacman (yes, also after a reboot)... so i'm back to the XferCommand option..
Comment by Robert Lewis (niriven) - Wednesday, 30 December 2009, 15:09 GMT
If you don't mind trying somethimg, it will let me know if this is a problem as described below:

"By default, glibc performs IPv4 and IPv6 lookups in parallel since +version 2.9 (though many distribution packages of glibc are known +to disable that behavior in this version). Some appliance DNS servers +cannot handle these queries properly and make the requests time out. +This option disables the behavior and makes glibc perform the IPv6 +and IPv4 requests sequentially (at the cost of some slowdown of the +resolving process)."

In order to "fix" this:

Add to /etc/resolv.conf.head (or create it if it doesn't exist):
options single-request

Of course, if it does not work revert your changes :)
Comment by Mark (markg85) - Wednesday, 30 December 2009, 15:13 GMT
Nope, still a 5 seconds wait with even wget.
Command used:

wget http://aur.archlinux.org/packages/alfresco-community-tomcat/alfresco-community-tomcat.tar.gz

Just a file to test.
Comment by Gerardo Exequiel Pozzi (djgera) - Thursday, 21 January 2010, 06:32 GMT
  • Field changed: Status (Unconfirmed → Waiting on Response)
status of this?

Loading...