PDA

View Full Version : Why is yum so slow?



Karmaflute
24th June 2009, 04:21 AM
It's taking forever to download fedora/primary_db. Why am I only getting 12 kb/s?

nirik
24th June 2009, 05:54 AM
You are likely hitting a slow mirror for some reason.

Try doing a 'control-c' and see if it switches to a faster one?

CSchwangler
24th June 2009, 07:54 AM
Is it only yum that is so slow? Have you tried to do a internet connection speed test? There are particular servers you can use for these tests. Is there anything else connected in your network which may steal your bandwidth?

glennzo
24th June 2009, 08:12 AM
I'm with nirik. Hit CTRL-C once and yum will look for other mirrors. Most of the time there's a 10 fold increase in speed.

lovetide
24th June 2009, 08:32 AM
maybe you can install yum-fastestmirror first, and then yum upgrade others...

Demz
24th June 2009, 08:44 AM
ever tried cleaning the cache to?
su -
password:

yum clean metadata

yum clean all

glennzo
24th June 2009, 09:20 AM
Taken from man yum:


yum clean all
Runs yum clean packages and yum clean headers, yum clean metadata and yum clean
dbcache as above.
So all you need to run is yum clean all.

glennzo
24th June 2009, 09:47 AM
I'm looking into using yum-updatesd and / or setting keepcache=1 in /etc/yum.conf. I've installed yum-updatesd but will have to wait a few hours to see if it makes any difference. I'm not sure what will happen to my disk space if I allow keepcache=1 though.

Hlingler
24th June 2009, 04:44 PM
I'm looking into using yum-updatesd and / or setting keepcache=1 in /etc/yum.conf. I've installed yum-updatesd but will have to wait a few hours to see if it makes any difference. I'm not sure what will happen to my disk space if I allow keepcache=1 though.Disk space usage will (surprise!) increase, amount depending of course on number of repos enabled and number of updated packages selected. The default is keepcache=1, so there should be no change, unless you previously had set it to '0'. Personally: I see no value in keeping the RPM packages cached after a successful update, unless perhaps you share the cache between computers - in which case, it would certainly decrease downloads.

V

weitjong
24th June 2009, 06:20 PM
Besides installing yum-plugin-fastestmirror package, you can also try one of these two approaches to ensure only mirrors that are nearer to your location are being used by yum.

1) Modify the yum configuration files in the /etc/yum.repos.d to pass in extra "country" request parameter followed by a list of 2-letter ISO codes in the URL value for the "mirrorlist". For example, as my location is in Singapore, I could have my URL changed as follow:



[fedora]
...
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$releasever&arch=$basearch&country=SG,JP,TW



[updates]
...
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f$releasever&arch=$basearch&country=SG,JP,TW

You can try out the above URL in your browser after substituting the $releasever and $basearch with values, say "10" and "x86_64", respectively. You will see it will just return mirrors from these three countries that I specify. The fastestmirror will further sort the fastest mirror out among this already shortlisted mirrors.

Of course, not every county has a mirror site for Fedora. So try to experiment with the URL to find out the best country list that works for you.

2) Instead of relying mirrors.fedoraproject.org/mirrorlist to return the list of the mirrors, prepare a static mirror list yourself in a file. Let's say this file is called in "/etc/yum.repos.d/my-mirror-list". Then modify the yum configuration file so that the URL value for the "mirrorlist" is as below:


mirrorlist=file:///etc/yum.repos.d/my-mirror-list

The file can contain as many mirrors as you like, but the format must be exactly as it would be returned by the http://mirrors.fedoraproject.org/mirrorlist. Just as an example, I have something like this in my local mirror list.

Fedora-local-list

# Local mirrors closest to SG
ftp://ftp.jaist.ac.jp/pub/Linux/Fedora/releases/$releasever/Everything/$basearch/os
ftp://ftp.iij.ad.jp/pub/linux/fedora/releases/$releasever/Everything/$basearch/os
ftp://ftp.twaren.net/Linux/Fedora/linux/releases/$releasever/Everything/$basearch/os
ftp://mirror.nus.edu.sg/pub/fedora/releases/$releasever/Everything/$basearch/os

Fedora-updates-local-list

# Local mirrors closest to SG
ftp://ftp.oss.eznetsols.org/linux/fedora/updates/$releasever/$basearch
ftp://ftp.iij.ad.jp/pub/linux/fedora/updates/$releasever/$basearch
ftp://mirror.nus.edu.sg/pub/fedora/updates/$releasever/$basearch

Refer to http://mirrors.fedoraproject.org/publiclist/ to obtain the the country ISO & mirror list.

Hope this help.

Telliria
24th June 2009, 10:11 PM
Another way to speed things up is to use presto which uses delta rpm (only downloads the new part of a package). If you're using F11 just use the command (as root)


yum install yum-presto


Read more -> https://fedorahosted.org/presto/

glennzo
24th June 2009, 11:02 PM
@Hlingler. Keepcache was set to 0 by default on this F11 box.
@Weitjong. Interesting stuff you suggest. Maybe I'll play around with it. Thanks.
@Telliria. Already have presto installed, on ALL the Fedora boxes here.

Simian Man
24th June 2009, 11:46 PM
maybe you can install yum-fastestmirror first, and then yum upgrade others...

This happened to me a while ago, and fastest-mirror solved it dramatically. Though that was a while back and I haven't needed fastest-mirror since.