Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Over the years using various linux boxes, I've gotten into the habbit of using prelink ritually to accelerate load times of applications.

However, the benefits of running prelink are negated every time a package is reinstalled, as it, all its dependencies, and its dependents, need to be re-prelinked.

This prelinking can cause multiple problems, and one as such is binary MD5 invalidation, which problematic for things that compare MD5 vs upstream revisions or use MD5 for determining whether or not the binary has been changed and is thus not wanted to be cleaned upon package removal.

Recently, computers have gotten a lot faster, and the benefit prelink yields is now hardly notable.

Is using prelink still a rational concept, or can it be casually discarded and left behind as something of a past era?

share|improve this question
add comment

6 Answers

You can't read it until 23rd July 2009 unless you're subscribed to LWN.net, but you might find http://lwn.net/Articles/341244/ useful.

share|improve this answer
    
Then you could provide a "suscriber link" to this article. –  wazoox Jul 16 '09 at 12:55
2  
I always feel bad for using subscriber links. Like I'm ripping them off or something. –  David Pashley Jul 16 '09 at 13:54
    
I agree. I don't mind providing subscriber links to direct contacts (friends or coworkers) when I come across an interesting article, but it feels wrong to post it publicly. –  Christopher Cashell Jul 20 '09 at 15:48
add comment

I wouldn't say that it should be arbitrarily discarded, however I would definitely say that it's use should be given a little more thought.

On a modern higher-end machine that is being frequently updated, prelink may not be a useful optimization. However, there are still a number of cases where it could be worth using. For example, on an older or lower end machine, or on machines that are fairly static and don't experience frequent changes or updates. It could also be worthwhile if you have a high rate of programs being run repeatedly (I can think of a couple of situations where you might have programs being run in rapid succession or in parallel where prelinking could improve performance).

All in all, you need to consider your specific situation, and then decide whether the benefits outweigh the additional work and effort.

share|improve this answer
1  
"a high rate of programs being run repeatedly" - if you're in that situation, the binaries and libraries will end up in your filesystem cache. The only time prelinking would help is if you are so memory starved that you have very little fs cache available –  Daniel Lawson Jul 19 '09 at 20:50
    
Prelinking will speed up program start even if the program is stored in filesystem cache. Admittedly, when the program (and associated libraries) are cached, the performance increase is less noticeable. However, depending on the rate of programs being run, a few microseconds can add up to eventually make a difference. –  Christopher Cashell Jul 20 '09 at 15:50
add comment

I think with the prices of memory falling prelinking is becoming less useful. If you still want to speed things up slightly you might look into preload.

share|improve this answer
    
I tried preload, I just found it made startup times slower while it sat there chewing both cores doing the readahead thing. And it also for some reason I cant make out caused X to die during boot. Also, if you don't reboot often, preload stops being useful at all. –  Kent Fredric Jul 12 '09 at 6:40
add comment

I leave that decision to OS version. If by default OS chooses to call prelink regularly using cron then fine else may be it is not so useful. I hope the creators of distributions have given thought before choosing to add / remove prelink option by default. So I go with them rather than analyzing things again myself.

share|improve this answer
    
er, its not really defaultable, its a package you have to install, and if its not installed you don't get prelinked stuff. If its installed, it tends to create a cron script, which is off by default, which you have to manually enable. –  Kent Fredric Jul 12 '09 at 6:37
    
It is default on fedora not off by default. It is reniced to 19 but not off. It has been same since Fedora 6 or 7. –  Saurabh Barjatiya Jul 12 '09 at 10:54
add comment

Gentoo uses prelink. They get around the md5sum issue by ignoring the prelink info hen calculating the hash.

Prelink will always give you a speed boost although it may become less and less noticeable as hardware gets faster. The only way to know for sure on your hardware is to turn off prelink and see how you like the slowdown on app launches.

Sidenote: OS X used to do a form of prelinking as well but that has been abandoned in favor of a linked cache that the linked maintains itself. Best of both worlds, no binary changing and no real overhead versus normal linking. I hope Linux picks up this idea at some point :)

share|improve this answer
1  
It doesn't really... its still something you have to install and configure, I say this because I am using gentoo. And you cant exactly "turn off" prelink, you can only stop running prelink, or go and unprelink your whole system. Also, for some reason unbeknownst to me, paludis has issues with prelinked binaries, and without an undo-prelink hook ( unsupported ) it leaves binaries behind, yielding cruft. Recently I discovered a few KDE apps that were left behind because of fact before I installed the hook, and they were in the path before the newer ones in a different location, causing seg's –  Kent Fredric Jul 14 '09 at 11:31
    
Possibly, enabling linker optimization ( -Wl,-O1 ) ¸and the new changes in gnu-hash allocation is more akin to what OSX has moved to, which is possibly a more effective choice. –  Kent Fredric Jul 14 '09 at 11:33
    
I must admit it's been a while since I used gentoo... I have since moved on to OS X :). I remember a test I once did on OS X: start all applications at once and time that (about 1 minute iirc). Then, remove all prelink information and start all apps again. That time it took 5 minutes... This was in 2005 on a tower Mac, a real beast. –  w00t Jul 16 '09 at 7:07
add comment

I would say prelink is definitely useful on multi-user desktop servers such as LTSP servers used in schools and net cafes for example. Not only does prelink speed up application loading, but it also improves RAM utilization and disk thrashing due to contention between users, allowing many more simultaneous users on a server.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.