dcsimg

Having Yum for Breakfast

In this wide world of Linux, there are primarily just two package management systems which reign: RPM and Deb. Most binary distributions use one or the other and there has long been tension between the two. So which system performs better?

Package management is one of the selling points of Linux distributions. Nothing else comes close. While many argue that it’s much easier to install programs on other operating systems such as Windows and OS X, nothing could be further from the truth. At least, when it comes to officially supported packages.

Within other operating systems if you want to install a program, you first have to find something that’s suitable. This would normally entail a search on the Internet or talking to friends. It might even require visiting a software store and parting with some hard earned cash! Next, insert the physical media (if required), install the software by running through the installer clicking “Next” several times, download updates and if all goes to plan, be on your way.

In Linux however, everything is integrated and simple to use. Most of the software you’ll ever want to install is not only search-able from a single window on your desktop, it’s also installable with a single click. Not only that, but for the extra charge of absolutely nothing all future upgrades are taken care of for you, along with the rest of the system.

The problem is that generally it’s a very distribution specific thing, because, well that’s what distributions do. Each system is built with their own version of various system libraries and even though binaries may work across several distributions, they are just as often incompatible. While users can download and install packages themselves, the system is best controlled by a package manager which keeps track of everything. Installing packages manually might by-pass the manager, making the system inconsistent. Therefore, most packages are managed through a repository; a database of available applications. If an application the user wants is not available in an official repository, there are hundreds of extras available on-line. If a user can find an appropriate binary for their system, package managers can install it along with any required dependencies automatically – so long as they are available in the repository.

But why are package managers so important? Well, due to the fact that most of the software available in Linux distributions is free and open source, they are built upon that heritage. Part of this is a belief in “not re-inventing the wheel”. Most open source projects will take advantage of other code in the form of a library, which enables extra functionality for next to no effort. While software for Windows and OS X often includes all the libraries they need within the program itself, Linux makes the libraries available to the entire system so that any program which needs it, can do so without having to duplicate them. This means that a particular piece of software may not run if it doesn’t have the required libraries! Arising out of the need to install, track and manage all these dependencies, package management systems were born.

Packages in Linux generally fall into two main categories. Either source code, where they are compiled from scratch and installed directly onto the system, or pre-compiled binaries. Binary packages are then usually one of three types: RPM (RPM Package Manager) from Red Hat, Deb (Debian packages), or plain old tar balls. When looking at these files at a low level, there is not much difference. Technically an RPM and a Deb are very similar, they both contain the binary application itself and meta-data which a package manager will use. Also, installing a package rarely takes up lots of resources, it’s mostly just extracting an archive onto a file system and marking it as “Installed” in a local database. It’s generally the database queries, look ups and calculation of dependencies which introduce differences in performance.

Still, if you’re a Linux user content with what your distro has to offer you then you might not care how well your package manager performs. Even if you are, graphical interfaces these days are very similar and so switching between distros does not pose much of a learning curve. With all the changes that package management has been through, you might think there would be a single package management system. One that was so powerful that it just had to be used by everyone. Well there isn’t yet, although some are in the works such as PackageKit. As previously mentioned, most distributions are based on one of those binary formats, which then add a package management layer on top. Naturally Red Hat’s Fedora uses RPM, while Debian and variants such as Ubuntu use Debs. It would be a cold day indeed to see one adopt the other!

Citing improved package management performance as one of the new features, we recently took a look at what the new Fedora 11 Leonidas release had to offer over the previous version. Now the time has come to compare Red Hat’s package manager to one of the most popular, that of Debian. So, how do they compare?

Firstly, some words on our two opponents as they are not created equal. Fedora 11 was recently released and includes a newer kernel and version of GCC than Ubuntu does. Even though the two are very different, there are many core similarities. Both provide basic package management tasks such as searching, installing and removing applications. While the sizes of the local package databases will not be the same, it is the differing implementations of the manager itself which will impact the most. For the tests conducted, they have been made to be as fair as possible. For the package installation test, a native version of a binary for each distro was used which required no dependencies. The 14MB files were within 100Kb size of each other, so this should reflect the handling of the file rather differences between the files themselves. Other tests are not so even keeled. For example, when updating the package database, Ubuntu has to handle many more repositories then Fedora (and yet it still manages to come out on top).

The test system used included an AMD Athlon64 CPU with 1GB of memory. Both operating systems were 32 bit only and included the respective default GNOME environments. Each test was run ten times and the results logged. After every single test, the computer was re-booted so that cached memory could not interfere with the result. The average of these results was then taken to provide the values represented below. Let’s take a look.

Time based results of package management tests
Time based results of package management tests

Ubuntu was faster in every single test, with considerable improvement over installing and removing packages.

CPU usage results of package management tests
CPU usage results of package management tests

Once again we can see that Ubuntu used less CPU when performing most of these tests compared to Fedora, with the exception of two.

Comparison of speed performance factor
Comparison of speed performance factor

Ubuntu effectively trounced Fedora in every single test from the smallest factor of two, to over fifteen times.

Comparison of CPU usage factor
Comparison of CPU usage factor

Here we can see that Ubuntu was also more CPU efficient than Fedora, except for two areas by a small margin.

Package management under Linux is an art which is taken for granted by many. In light of these results it is important to note that most users won’t care about how fast or slow transactions are, but rather let the package manager do what it needs to in the background. After all, most have come from a system where none existed at all! Still, for terminal junkies and those who work with packages on a day to day basis, dealing with a slow and weary package manager can be torture.

There’s no doubt that for staunch supporters of either camp it will continue to be a fiercely contested issue. Either way, when you look at the numbers Yum is completely trounced by Debian’s aging package management system. Fedora 11 might have introduced a few new improvements to RPM, but perhaps it needs a complete overhaul if it’s to ever compete.

Comments on "Having Yum for Breakfast"

parnote

What a shame it is that Synaptic is no longer being actively developed for RPM based distros. Soon, we will reach the end of the line for being able to use Synaptic with RPM based distros, and those distros that are RPM based and use Synaptic will have to have a replacement strategy in place. YUM doesn’t appear too “yummy,” and even less so after the tests in the article. For those of use using RPM based distros using Synaptic, we can only hope that someone will change course and re-start development on Synaptic for RPM based distros.

Reply
daveroberts

So a couple of things:

1. Does this really matter? I mean maybe if I’m doing a massive upgrade of 200 packages, but I really don’t do that very often. For a single package update, does it matter if it takes 23 seconds vs. 7 given the frequency of the operation and the absolute difference? Sure, smaller is always “better” in an an absolute sense, all things being equal (and we’ll get back to that in a second), but do you really care if you don’t do it that often?

2. Second, are all things equal? From what I understand (and I’m not an expert here), RPM has a lot more support for transaction in the install/update process to ensure that everything goes smoothly and that you can recover if it doesn’t. In other words, saying Deb is faster than RPM is about like saying that MySQL is faster than PostgreSQL, but ignoring the fact that MySQL was running in a mode without any transactional properties. It’s only faster if you want to take the risk of a mid-install/mid-upgrade failure messing up your system and then having to recover that by hand.

Reply
dwolsten

daveroberts: Yes, I think it does matter. Back when I used to use SuSE with RPM, updating packages was really quite slow, and I’m always amazed now that I run Kubuntu when I do an update, how fast it is. Why would I want to go back to dog-slow updates?

Remember, updates on Linux systems are pretty frequent, with all the security fixes in all the packages; I usually have to apply an update every few days, even if it’s just for some program that I rarely use. With Kubuntu, it’s really painless and fast, just a couple of clicks and it’s done in less than 30 seconds usually, unless it’s a kernel update (and even those are pretty fast).

I used SuSE for many years, starting in 1999, so I’m pretty familiar with both. Looking back, the only thing I like better about RPM is the command-line options: RPM had easy-to-remember options, especially those for queries: “rpm -qx”, whereas dpkg’s options for me aren’t as easy to remember. But that’s really just a personal preference and a minor quibble, especially since I usually do updates from the GUI program in my task tray. The entire apt-get/dpkg system works so much better than RPM and Yast it’s not even funny. Plus, the Ubuntu/Debian repositories have so much more software that others really don’t compete well.

Reply
bugmenot

One area not tested is download size for updates. With Fedora 11′s new Presto feature, you can download deltarpms rather than the full rpm when updating. For most people, it takes more time to download the packages than install them (whether you’re using yum or apt-get), and deltarpms can reduce download size significantly.

Reply
csmart

Hey bugmenot,

That’s true, but it’s rather hard to test, especially when connection speeds come into it and finding packages the same size. I think it’s safe to say that you’ll be downloading less by using the deltas than you would on Debian.

For these tests, all packages were pre-downloaded so bypass the network download issue.

Cheers,
Chris

Reply
turb0chrg

Thanks for the article. While CPU is great, I am particularity interested in memory usage by the package manager process and its tools. I have a 128MB VPS that YUM doesn’t work too well if there are too many packages to update at once. It runs out of memory even if I shut down everything on the server and there is ~100MB free. I wonder if aptitude is more efficient?

Reply
warpengi

Warning: I know this is pedantic.

Neither rpm or deb are package management systems as stated in the headline. Was this lead written by an editor? No, further down in the article deb is referred to as the package management layer in Ubuntu and rpm for Red Hat.

Of course we all know that rpm and deb are both package FORMATS and that rpm is also the name for the application that performs low level install functions for rpm packages. Dpkg does the low level install functions for deb packages.

Yum and Apt are package management systems. They perform dependency checking, fetching, recursive uninstalls and include a repository format among other things. One major difference (imo) between yum and apt is that yum is a command line tool with a gui frontend while apt is strictly a command line tool with 3rd party applications providing the gui.

I’m not surprise at the results. Red Hat provides an nice package format with rpm but has never been the leader with a great package management system. Mandriva, and Suse have been the leaders for rpm packages although no one else seems to use their tools.

Yum is a recent arrival. Having gone through red carpet and up2date I think Red Hat has finally found a package managing system they will stick with for a long time.

Reply
csmart

turb0chrg, I tried to get memory stats via GNU time, but it doesn’t work well.
I could have done this another way obviously, but didn’t.

warpengi, you’re right. Thanks for the clarifications :-)

-c

Reply
felipe1982

It would be nice to see a comparison of Debian vs Ubuntu vs OpenSUSE (zypper)

Reply
acid_1

I imagine that Ubuntu and Debian would be very similar. And openSUSE is incredibly slow, I’ve tried to use it, but the Package manager is so awful. Sorry for the fans of it, besides that I really do like oS.

Reply
lucifred

acid_1: glad to hear you like it. You are right about the 10.x openSUSE having a slower update stack, but the 11.x series has an install and update system considerably faster than Yum, see:

http://duncan.mac-vicar.com/blog/archives/309

Reply
bendib

My friends, there are other ways to manage packages with a GUI besides synaptic, and yum is easily fixed when there is a database error, but debs are hell. Did I mention I have never gotten a database error in RPM on my own machine? YUM is easier for me to use, and seems to install them instantly. So, yes, deb is faster, but RPM is more reliable.

Reply

Great points altogether, you simply gained a new reader. What could you suggest about your publish that you simply made a few days in the past? Any sure?

Reply

Hi my friend! I wish to say that this article is amazing, nice written and include approximately all significant infos. I’d like to see more posts like this.

Reply

The information mentioned in the report are a number of the most beneficial out there.

Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>