Return of The Carpet
Red Carpet, that is. Yes, that Red Carpet. I’ve taken some time lately to give some love to our old friends rcd and rug (the original rug, not the rewritten one). First I got everything building on a modern distro (openSUSE 10.2). This took more effort than I thought it would, but eventually things worked well. After that, I set out to make rcd more usable with yum services. Here is a list of the main changes:
- Add native yum support. I removed the ‘helix’ service support and replaced it with something that understands yum metadata. This means you can just do ‘rug sa repo_url name’ for any yum service. I used the excellent yum parser that Tambet wrote for the libredcarpet backend of zmd to accomplish this.
- Remove channel subscriptions. Since yum services don’t provide multiple channels, subscriptions aren’t really necessary. They have been replaced with the ability to disable a service.
- Add sleep ability. One of the main complaints against rcd was that it used too much memory. This was mostly because over time the heap would become fragmented. The ’sleep’ feature avoids this by running the main rcd daemon only when necessary. After a period of inactivity (3 minutes by default), the main daemon replaces itself with a smaller daemon. This smaller daemon simply waits until a request comes in and launches the full daemon to respond.
With the above changes, rcd is once again a joy to use. I would like to get the GUI working again, but there is some kind of threading problem preventing it from running. I would also like to add ftp support, but that is not a top priority.
I know there are probably SUSE users reading this asking “Ok, sounds fine, but is it fast?”. While it may not be the fastest thing out there, I think you will be surprised at the results (I was). Here are a few simple benchmarks from normal usage scenarios:
First, lets look at the number of services I currently have added:
% rug sl # | Service URI | Name ---+-------------------------------------------------------+------------ 1 | http://go-mono.com/download-stable/suse-102-i586?r... | mono 2 | http://software.opensuse.org/download/FATE/openSUS... | fate 3 | http://ftp.suse.com/pub/suse/update/10.2/?name=upd... | updates 4 | http://download.opensuse.org/distribution/10.2/rep... | suse-nonoss 5 | http://download.opensuse.org/distribution/10.2/rep... | suse-oss 6 | http://packman.inode.at/suse/10.2?remote_only=1;na... | packman 7 | http://software.opensuse.org/download/home:/cybero... | cyborg 8 | http://software.opensuse.org/download/X11:/XGL/ope... | xgl 9 | http://software.opensuse.org/download/Beagle/openS... | beagle 10 | http://software.opensuse.org/download/games:/actio... | games 11 | http://software.opensuse.org/download/Virtualizati... | virt 12 | http://software.opensuse.org/download/home:/kraxel... | kvm
So 12 services, and the package count is almost 21000. 22500 if you also count the ones in the rpm database. How long does it take to load all of those?
Cold filesystem cache, daemon is sleeping:
% time rug ping > /dev/null rug ping 0.17s user 0.02s system 1% cpu 13.735 total
14 seconds to respond isn’t terrible, considering the cold filesystem cache. Now that the kernel has it cached, though, how long does it take?
Warm filesystem cache, daemon is sleeping:
% time rug ping >/dev/null rug ping > /dev/null 0.14s user 0.02s system 3% cpu 4.465 total
4.5, not bad. Definitely in the tolerable range, I’d say. Of course after the daemon is awake, commands respond immediately. That is maybe the only good thing about rcd being a daemon — subsequent commands are instant, where other tools (yum, smart, etc) have to load the package metadata again. Memory usage after rcd wakes up is about 28MB, so that is not too bad either (it is a little over 1MB when sleeping).
Packages for recent SUSE distros are available in the build service. It has had a hard time keeping up recently, though, so you may run into a problem or two with rug. Sources can be found in gnome svn in the yummy branch of the various modules (rcd, rug, libredcarpet).
Also, yes, I am sick sick person.
April 26th, 2007 at 5:51 pm
[…] James Willcox has brought rug (the old version, written in python) and rcd back to life! […]
April 26th, 2007 at 8:29 pm
Wow, this is awesome news! I’ve been wishing for this for a long while now.
You just made lots of SUSE users quite happy, myself included. (:
April 27th, 2007 at 2:39 am
Thank you so much for this. While zmd wasn’t enjoyable on opensuse at all, relying on zypper isn’t making me feel any better. I did run into trouble though…
The only thing I noticed is that the rug package wasn’t available for Factory, only for 10.1 and 10.2. I installed rug from the 10.2 repo. Everything seemed to work, I added the opensuse repositories using `rug sa`, but now I get:
cernousek:~/rug # rug sl
Traceback (most recent call last):
File “/usr/bin/rug”, line 53, in
rcmain.main(rug_version, rug_dir)
File “/usr/share/rug/rcmain.py”, line 237, in main
command.execute(server, opt_dict, args)
File “/usr/share/rug/commands/rcservicecmds.py”, line 64, in execute
self.columned_output(server, services, show_ids, no_abbrev)
File “/usr/share/rug/commands/rcservicecmds.py”, line 79, in columned_output
if serv[”is_disabled”]:
KeyError: ‘is_disabled’
Hints?
April 27th, 2007 at 3:56 am
Great news, I’ve been looking into porting the Red Carpet to PLD Linux, now that the rcd works again, it’s a matter of getting the GUI to work.
Hope to hear more about the progress
April 27th, 2007 at 6:23 am
Yay! Go Snorp! Long live rcd.
(Any idea if the dpkg backend still works…?)
April 27th, 2007 at 7:43 am
You sick bastard.
April 27th, 2007 at 9:35 am
wooooo - I can finally update SLED without a coffee break. Awesome work man
April 28th, 2007 at 4:19 am
It’s really fast… But I would like to know if we can update suse, from one version to other (for example, from 10.2 to 10.3 when it will finish), via rug (like apt in debian), and without make a cd-update (with all the things this it entails; stop services and machine, etc, etc).
It’s a great new. Thank you very much and excuse me my bad english.
March 4th, 2008 at 4:20 pm
[…] you’re like the cool kids and use the lightning fast red carpet, however, you can […]