The Shiny New DNF, and Why I Prefer Yum!


You certainly already know about DNF, the new package manager in Fedora which is available in Fedora repositories since Fedora 18 while Yum is still the default (command line) package manager. However, DNF is expected to replace Yum as the default command line package manager in Fedora 22. And so, every Fedora user should consider it seriously.

DNF has some interesting properties that I really liked about it. Probably the most visible one, and certainly the most exciting one for me, is speed. It is really much faster than Yum. Yum spend much time specially when starting up. For example, I ran a similar “list” command using both DNF and Yum for a few times. Yum took around 25 to 29 seconds to do it, while DNF did it in about 5 seconds (no downloads for both). I don’t know what does do during this period, but my HDD is busy most of the time.

Surprisingly, Yum downloads compressed SQLite metadata, but DNF downloads compressed XML metadata. The former is considerably larger than the latter, but Yum selected it for speed purposes! AFAIK, DNF (actually libsolv) doesn’t use XML metadata internally but converts them to its own format; and IMHO this is actually the right thing to do. Yum could also use a similar approach (I’d prefer), but maybe they preferred to waste bandwidth rather than client’s processing power (and yum wouldn’t be faster than today anyway).

It was great news for me; not only DNF is way faster than Yum, but also it downloads much smaller metadata (about half the size of compressed sqlite dbs used by Yum)… However, I was wrong; The amount of metadata downloaded by DNF is actually more than that of Yum! I saw that Yum downloads about 20M of metadata for fedora-updates repository while DNF get around 30M! Why? Because DNF is too lazy and downloads all metadata, including list of all files in all packages which is around 15M; while Yum only downloads list of files when they are actually needed. And in my system, Yum has never downloaded the list of files while DNF downloads them every time the repository is updated. I always hated Yum for downloading such a large metadata over and over again, and DNF is just horrible. Unfortunately, DNF author has no will to change the situation.

Actually, I use two plugins with Yum which I’d like to have in DNF too: yum-plugin-local and my own Yum Fast Downloader. The former is not that important, and I can live without it; and I hope to be able to create an equivalent of the latter, while it will need a completely new approach.

Currently, I use DNF for some operations like search and list commands, but use Yum for most other tasks. And I almost always run DNF from cache, except when I have free Internet access! I’ve also disabled automatic cache download by DNF, which can make DNF much more hostile!

DNF can eat your Internet credit silently!

Let’s assume that you pay for your Internet connection per GiB. And you install Fedora with DNF, and use it for one month. You never use DNF during this month. Now, you might get shocked that DNF has used about 1GiB of your internet credit, while you have not used it at all! Even if you decide to use DNF after one month, what you get is the latest metadata. So, 30MiB of that 1GiB is what you actually used. Yes, this is currently the default settings, which I consider insane. If Fedora 22 is released with DNF configured like this, it means that: Fedora 22 consumes about 1 GiB of your internet connection by default just for downloading repository metadata! Surprisingly, even if you update your Fedora regularly, the amount of actual data you download to update your Fedora might be less than that (thanks to delta RPMs).
Its true that the repository metadata format is currently very inefficient for updates and you should get all metadata again even if one package is added, and it is not DNF’s fault, but the decision to download metadata automatically, and downloading unnecessary metadata, is what DNF has made. That makes sense for people who have access to cheap internet, or don’t pay for it per GiB; but IMHO this should not be the default settings for a distribution like Fedora.
And, 1 GiB per month is just an estimate. I assumed that updates are pushed to Fedora updates repository once per day, and the metadata is around 30MiB. However, if, for example, updates are pushed two times a day, the estimate would be around 2GiB. Notice that with the default settings, DNF refreshes metadata every 3 hours. So, if there are regular updates in Fedora updates repository, DNF would re-get metadata up to 8 times a day, which will be around 8*30=240MiB per day, which will be 8GiB per month…

Anyway, if you happen to install DNF, make sure that you check metadata_timer_sync option in “man dnf.conf” and put an appropriate option in your dnf.conf. I use “metadata_timer_sync=0″ as I don’t want it to waste my money for no good!

 

About these ads

7 responses to this post.

  1. Posted by Rick James on July 27, 2014 at 2:38 pm

    Let’s be honest here. ever since fedora 14 [which was the last decent release], and the arrival of Gnome 3, Fedora has become shitter and shitter with every new release.

    Reply

    • Posted by Bob on July 28, 2014 at 12:53 am

      NO! I think Fedora is aways better than before and fedora 20 is one of the best distros that I have ever used.

      Reply

    • Everybody has its own opinion. I also think that Fedora 20 is much better than Fedora 15. And about Gnome 3… well fortunately there are alternatives like MATE and etc.

      Reply

  2. DNF only download metadata if it is changed, so only repomd.xml is download every time, so the updates metadata will only be download one a day if updated,

    Reply

    • I think it would be helpful if it was possible for DNF to question NetworkManager about the connection type, and to not download metadata if on mobile broadband. I think some previous version of Fedora’s package management GUI had an option for this – ??

      Reply

      • Yes, PackageKit did it before (I don’t know what is its policy after introduction of “software” application). And it will make the situation slightly better. But I think this is not reasonable for Fedora to download around 1GiB per month even when it is completely idle! Even when you are not on broadband. It’ll cost for many users.

    • Yes, and this is why I said that the amound of data DNF could silently download can range from 1GiB (assuming updates are pushed once a day) up to 8GiB (if new updates are available every 3 hours).

      Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 671 other followers

%d bloggers like this: