Preload is a Linux daemon that stores commonly-used libraries and binaries in memory to speed up access times; similar to Windows Vista’s SuperFetch function. This article looks at Preload and gives some insight into how much performance is gained for its total resource cost.
Preload was written by Behdad, a Red Hat/Fedora developer and we had a recent discussion about including it by default in Fedora (it’s already in the repo). Before using preload, you might want to read
http://permalink.gmane.org/gmane.linux.redhat.fedora.devel/74769
I always thought that disk cache was meant to speed up operating system and applications performance? Why use “prefetch” and waste disk cache now?
What the point of copying libraries TWICE (first time prefetch and second actual launch)- you do run application from hard drive, not from memory I presume.
There’s a difference between having a library in disk cache, and having it actually loaded and mapped in to the system. In theory, once the library is loaded and mapped, at that point it can only take VM space (not necessarily physical memory space). Which basically comes down to if the library is swapped out, is that better, worse, or the same as having the library not loaded at all. That I don’t know, and I don’t know if any of this has actual impact on the user experience.
Prefetch doesn’t “waste disk cache”. Disk cache starts empty and provides no boost until it gets content and begins to eliminate the need to physically read disk blocks. As you read-in blocks, it attempts to get rid of useless disk cache blocks based on a algorithm like “get rid of least recently used.” The only way prefetch could hurt would be if the algorithm mistakenly thought there was a higher likelyhood the prefetched blocks would be used than some other recently read blocks. That is unlikely.
I guess a highly aggressive prefetch might cause problems. It’s one thing to fill disk cache with potentially useful blocks just after booting–that’s pretty harmless– and another thing to start reading-in files for one application while another application is running because you expect the user to do it next. I think it all depends on how aggressive the prefetch is.
You all seem to be confused. Preload uses RAM to cache recently used programs. Nothing I know of at the moment uses the hard drive to do this as it would be just as fast loading the program as you normally would. You guys may be thinking of swap space which is only used when you run out of available physical memory. If you run in to this situation while preload is running than I’m sure you will see a greater performance hit, but if this happens at any time than you will still be seeing a performance hit and preload running or not would be the least of your worries. RAM is cheap right now so stock up if this happens a lot.
I just learn about preload 1 hour before that post… and got excited about it then I realized it was not updated in 2 years and that attempt to add it to Gentoo were canceled (from what I read in bug reports at least) due to lack of improvement and no upstream development.
The link pointing to the Redhat/Fedora discussion thread mentioned in the first comment gives lots information about the state of the project.
Although the project has “been idling in kind of unmaintained state” there seems to be lots of new interest and activity around it now, like merging of patches and fixing of bugs. So at least according to that information there should be a new release coming “sometime soonish”.
Edited 2008-02-25 21:24 UTC
openSUSE has been using this since 10.0, it was originally part of the now-defunct SUPER project, but the results were significant enough that they included the preload functionality in the main release.
In openSUSE, though, preload is targeted at specific apps, not coincidentally those that tend to have the longest startup times (FF, OOo2, GDM, KDM, Gnome, KDE, etc.), so I’m not sure that it really resembles SuperFetch in that fashion, at least from the “learning” POV. It’s basically preset with static entries.
From the link above to the RH article, I guess that is an advantage to their implementation. The drawback though is that the performance advantage goes out the window if those preload files aren’t kept up-to-date. I believe there was an issue previously where the gnome preload files were out of date, and it actually impeded the load time for GDM/Gnome rather than improve it.
You can also create your own static entries for preloading, but it’s a bit of a convoluted method and not something for Joe Average to try.
So it will be interesting to see where the improvements to preload take it.
In all honesty, from previous experimentations, I’ve often found a better, or at least more perceptible, performance boost from prelinking, but then that can be problematic as well.
it is one of the first things that i install after doing a new OS install.
not so much use if you you ar eshort of ram, but on a machine with 1 or 2 GB it keeps the free space full of useful stuff.
—
also on the topic of prelinking. dont try doing it on a recent ubuntu.
“Prelink is no longer necessary in Feisty. Feisty uses a new linking mechanism called DT_GNU_HASH which dramatically speeds up the linking process without the need for continuously running this prelink program. Again, prelink is NOT useful starting from Feisty”
http://ubuntuforums.org/showthread.php?t=74197
Edited 2008-02-25 23:06 UTC
Those two approaches are complimentary and are in fact written by the same Red Hat developer. Prelink was introduced in FC2 IIRC and hash was introduced in Fedora Core 6 first
http://download.fedora.redhat.com/pub/fedora/linux/core/6/i386/os/R…
http://sources.redhat.com/ml/binutils/2006-06/msg00418.html
Edited 2008-02-26 00:38 UTC
Good for them. Now will everybody please stop posting useless comments like “Fedora had feature X, Y months before ubuntu” in every ubuntu thread?
soon as Ubuntu users stop thinking every article is an ubuntu article.
but seriously its good to point out who writes these things cause it appears fedora/redhat are writing a majority of the stuff these days but nobody is giving them credit just using the software.
Ubutnu pays marketing to get certain ideas across in the press whats wrong with fedora’s way of marketing which is “we wrote that”
Fedora contributes a lot to OSS but so does many other. I don’t see why Fedora should be treated special just because they contributed to some project. Ubuntu wrote upstart for example which is being integrated in Fedora 9 but Fedora’s wiki doesn’t even mention ubuntu in the upstart articles, nor does it mention Sun in the OpenOffice.org article. But I don’t complain about that everytime someone mentions Fedora.
Edited 2008-02-26 11:54 UTC
a wiki isn’t a press release talking about how great a product is like a press article will. But yes the Fedora Wiki does point to ubuntu’s tech spec’s page.
When ubuntu came out ever Fedora thread was hijacked with but RPM sucks, apt-get, etc.
Fedora is trying to gain back some of that user base by developing software instead of paying people to write articles.
Ah you beat me to it
Fedora had everything before Ubuntu/GNU/Linux 🙂
The article isn’t about Ubuntu. The thread isn’t about Ubuntu. And you’re the first person dragging Ubuntu into the discussion.
Priceless. You guys kill me.
Perhaps you should read the parent posts before you reply next time?
I always thought that linux is soo superbly written that it doesn’t need stuff like preloads? So, after copying every UI paradigm from Windows, Linux architects will now mimic even the infamous Windows bloat?
Pre-loading helps overcome the slowness of hard disks.
Hard disks are the same devices on Linux as they are on Windows … running Linux won’t make your physical hardware any faster.
I have tried pre-load on my system, which is a modest AMD AM2 64-bit system, but it has 2GB RAM installed.
Preload makes a significant improvement in application load time, effectively using that 2GB of RAM as a resource that wasn’t being fully utilised before.
Even the loading of the desktop is faster … I think the pre-load is using the time you take to select your account & login with your password to pre-fecth useful stuff from disk to RAM.
All the useful programs load quicker. Even OpenOffice takes only a few seconds. Firefox takes just one or two seconds. Smaller often-used prgroms, such as nautilis, gedit & the terminal program, start virtually instantly.
Depending on your system, if you have spare RAM that is not normally used, preload can make a significant improvement in speed of applications startup.
I know what’s the point of preload… I have just seen linux crowd bash this kind of Windowsy optimizations one too many times.
If every new release gets so much slower than the previous one that you need such tools, then indeed you have a problem. If, on the other hand, you can use this kind of functionality to make your system run even faster, that’s fine (IMHO, of course).
Oh, and I don’t really want to discuss Vista’s performance nor GUI copyrights, two already beaten up horses.
And by the way, let’s hope this project gets some renewed love, it certainly does wonders if you have some spare RAM
Edited 2008-02-26 02:57 UTC
Don’t confuse mindless trolls with “the linux crowd”.
Seriously, the guy has written a scientific paper on the whole subject. If you still think this is “bloat” or whatever, go read his paper, and come up with some scientific data to disprove him.
Edited 2008-02-26 12:00 UTC
You seem to mistake some vocal Linux users with the whole of the community. A common mistake in both directions. There are Linux users who will never be positive of anything Windows does. Similarly there are Windows users who will never acknowledge the positive points of *nix.
Neither of the extremes are completely right, why not accept this and approach each OS, and their choices, based on their merits rather than what the vocal opposition has to say. In this case we are discussing a program that gives *nix users the option of caching commonly used libraries. The fact that Windows does a similar, or even identical, thing says little about the merits of the idea in Linux. Nor do the statements of the Windows haters who have cried bloat at every corner.
Rather than proactively denigrating a crowd who have not spoken in this article why don’t you discuss the article and the cost/benefit of the idea. The first step to building more meaningful dialog is by letting go of the bitterness about arguments unjustly laid upon your choices in the past. What is your experience with preload in Linux or the Windows equivalent? Do you find it to give a perceived performance boost? Also does MS prefetch anything other than IE and Office? i.e. does MS prefetch 3d party application libraries that are commonly used?
In the Linux world prefetching libraries has a distinct advantage over disk cache in a memory rich environment, but this application seems to be sitting on the cusp of being abandonware. I read the interview in the first post but am still a bit trepidatious about an app that came so close to abandonment. OTOH I suppose it is easy enough to uninstall if it does fall under the shadow of apathy. I am glad this article came up and pointed out a application I am unlikely to have tried otherwise. We will see how it goes.
I just installed it on Gutsy about five minutes ago. Programs seem to be starting quicker already as described. OK maybe this is subjective as I haven’t done any before and after comparison times.
OOo Writer opens in about 2 secs flat. I have a recent but low end system with a 2.88 MHz Celeron with only 512 Mb RAM. When, like at this moment, I am running only FF2 it uses about 250 Mb so I guess there is enough space left for Preload to work.
Then your thoughts were wrong. Either an idiot told you that, or you came up with that yourself while knowing nothing about operating system development.
Another polling deamon. Like it or not, GNU/Linux has a serious problem with regards to powersaving. While the Linux-kernel itself is fine, many userspace daemons are not. There are few things that drain battery life faster then these constantly polling daemons. Gnah.
linux’s preload is like the old XP’s prefetcher.
Vista’s Superfetch is much better, it is NOT just only a preloading.
Edited 2008-02-26 10:04 UTC
Just a quick question. Is this the reason why Vista just go crazy when idling? I almost got kicked out from the library because the machine started working like crazy when I was at the toilet, and the fan speed reached like 6000 rpm or something.
BeOS was much faster to boot on ancient computer than Linux or Windows are, I wonder if it had a preloader?
A preloader has normally no influence on the booting time.If anything it boots slower depending how the booting is handled.
Back then everything booted faster – some call it progress,some call it bloat…
I really like both BeOS and Haiku, very well designed.
Multi-threaded, lightweight, fast…
But the problem is that people don’t understand BeOS had few services running at boot and no real applications.
That’s one of the reasons it was faster than other systems!
Hmm obnoxious and wrong…
a) I don’t need 200 services running on my computer. Hence why I always start with absolute bare linux install, then I install what I REALLY need.
b) the number of applications developped for an OS – even though relevant to the survival of the OS – has nothing to do with boot time.
Edited 2008-02-26 17:41 UTC
BeOS had VERY little code to load to actually boot… and the code re-use from its C++ ideal helped a lot on that.
Just look at the /boot on your BeOS and compare it to you /System* and /Windows directory for a start… not just the total size and number of files/folders, but the size of each one compared…
…and QNX, that’s more *nix-like, had a nice boot speed too.
Ubuntu is planning to include a better solution:
https://wiki.ubuntu.com/DesktopTeam/Specs/Prefetch
This appears to be a prefetch for speeding up the boot process not not a daemon for speeding up the loading of user programs during normal desktop use like Preload. It is a replacement for the current Readahead.
Do we HAVE to do the “WE DID IT FRIST!!111shiftoneone!” crap?
If you want to get technical, the IBM s/370 did prefetching of data. Pretty much any older computer with libraries in ROM had more or less the same speed improvement going on (amiga, riscpc, ataris.. etc.).
IBM had a freaking patent for prefetching way back in 1973.
Sounds funny “111shiftoneone”. What is that a reference to? Damn, I don’t get it.
Ohh… exclaimation. I thought it was bit shifts or maybe ALT-222 codes or something.
God keeps score–no worries.
Edited 2008-02-26 14:49 UTC
heh. Just being an ass about people over doing exclamations and typo’ing them as ones
I dont get it. It is a solution that doesnt scale good. Say you have lots of users and lesser amount of RAM. If you just fill the RAM via prefetch, there will be lots of page faults. It can’t possibly fill the RAM up, in a way that all users benefit from prefetch.
Prefetch should be a ok solution if you have lots of RAM so you can fill it up. If you have lesser RAM and lots of users, then it is a very bad solution as it will generate page faults faster.
so if you don’t have gobs of free ram.. you don’t use it. wow, simple.