Slashdot Mirror


Preload Drastically Boosts Linux Performance

Nemilar writes "Preload is a Linux daemon that stores commonly-used libraries and binaries in memory to speed up access times, similar to the Windows Vista SuperFetch function. This article examines Preload and gives some insight into how much performance is gained for its total resource cost, and discusses basic installation and configuration to get you started."

22 of 144 comments (clear)

  1. LiveCDs do this... by SaidinUnleashed · · Score: 4, Informative

    This is exactly why live CDs like Damn Small Linux (and Knoppix, if you have a ton of ram) run so fast if you load the CD image to ram. Ram is fast!

    --
    Shiny. Let's be bad guys.
    1. Re:LiveCDs do this... by Anonymous Coward · · Score: 4, Informative

      Make sure you pass the "toram" parameter when you boot the livecd at the kernel load prompt. You can press the various function keys at boot time to find the correct method.

    2. Re:LiveCDs do this... by Ibn+al-Hazardous · · Score: 5, Informative

      You start with a false presumption. I do not know what distro you use, and can't tell you if that does anything nifty - but "Linux" sure as hell does not do this already. If another app has already loaded as shared library, it may well be in RAM but it can just as well be swapped out. For all other cases, the answer is probably that your shared libraries are not cached or preloaded - and so this will give you quite a speed up.

      The thing that eats all your RAM is nothing Linux specific at all, it is your applications asking for more RAM than they are currently going to use. Why should they do such a thing? Well, what do you think memory management would look like if hundreds of apps, daemons and kernel threads ask for two bytes at a time? It'd paint a pretty fragmented picture, so they ask for gobs of pages at a time. Pages seldom touched get swapped out, but still there's an awesome amount of overallocation - thus your memory seems to be 100% allocated 100% of the time.

      So, preloading libs that are frequently used is probably going to use your RAM in a more meaningful way unless you already have a problem with constant swapping.

      --
      Yes, I am a biological organism. All rumors to the contrary are just that, rumors.
  2. Re:What, what? by guruevi · · Score: 5, Informative

    I don't know what rock you were under, but preload has been available for a while:

    preload 0.2 release: 2005-09-01

    And it was there before as it was packaged in Gentoo (back when it was still popular) and Suse 9.3

    --
    Custom electronics and digital signage for your business: www.evcircuits.com
  3. Re:What, what? by bersl2 · · Score: 4, Insightful

    (or wherever Microsoft stole it from, if that's the case). OS X had prebinding before Vista had SuperFetch. And they got the idea from somewhere else.

    Just let it go. This pissing match over innovation serves no useful purpose.
  4. Hope... by deadmongrel · · Score: 4, Funny

    it doesn't make GNU/Linux as *fast* Microsoft Vista.

  5. Nice but... by pizzach · · Score: 4, Informative

    I never had any luck with preload the times I tried it (a year or two ago?). Nowadays I use alltray for preloading often used apps that are a bit chunky such as Firefox or Openoffice. Openoffice also has a built in preload feature...but you can use alltray anyway for the same effect.

    --
    Once you start despising the jerks, you become one.
    1. Re:Nice but... by Nemilar · · Score: 4, Informative

      Alltray and preload are two totally different things. With Alltray, you're talking about keeping the application open, just minimized to the system tray. With Preload, you're talking about caching the binaries/libraries in memory so when you do open the application, it's reading the data from RAM rather than the hard drive. Sure, AllTray moves the load to RAM, but at the cost of entire applications. The point of preload is that it just caches the most commonly used files.

      --
      Nemilar http://www.techthrob.com - Visit Me!
  6. Re:Security Implications? by Skapare · · Score: 5, Funny

    The normal ramdisk vulnerabilities.

    You mean like losing the data after a few hours of no power?

    --
    now we need to go OSS in diesel cars
  7. Re:What, what? by markov_chain · · Score: 5, Insightful

    innovation = first time to do something from your point of view

    invention = first time to do something ever

    Note how MS is always careful to point out they innovate.

    *flush*

    --
    Tsunami -- You can't bring a good wave down!
  8. Re:But I thought Vista doing it = RAM hogging? by Anonymous Coward · · Score: 5, Informative

    Vista's implementation is marketed as being useful for older, slower machines with less RAM, where it actually may be unwanted, and could cause performance issues (unless it's disabled below a certain threshold - it might be). It's only really useful if you have lots of RAM (around 2GB or so). Yes, SuperFetch has an extra mode where it uses a USB-2 stick as a secondary disk cache, but that's not what we're talking about here. That mode is generally perceived as a gimmick.

    Linux handles having lots of RAM a lot better than Windows (XP) does, because of differences in the way the caching system was designed. Linux (and OS X) was intended to run entirely from RAM and use little swap. I've run, say, OpenOffice once, not used it for several weeks, and the next time I start it it loads almost instantly, because it was still sitting in the cache. My machines have 2GB of RAM, with much less than 500MB actually in use - the remaining 1.5GB is being used as disk cache. Swap usage is either zero, or very close. Of course, performance goes to hell if you do something that flushes the disk cache, or if you try using such a system on a machine with 256MB of RAM.

    Windows, on the other hand, was designed to run almost entirely from swap, and tends to drop stuff from the disk cache when it's not been used in a while, as well as moving stuff out to swap rather aggressively. That works great if you barely have enough RAM to run the OS, but it's terribly wasteful if you have more than enough RAM. In this case, SuperFetch is actually useful, allowing it to catch up to and actually surpass Linux, by monitoring which files are actually used and making sure they're already in the disk cache.

    That's great, although nothing new. Other OSes have had this for years (this Linux implementation dates back to 2005, Mac OS X has had it for ages, and neither implementation was original) - Microsoft were just the first to brand it.

    TFA said nothing about Vista's implementation.

    I think the primary problem people have with Microsoft's implementations is that they're typically very complicated, and have a tendency to degrade over time. XP is the typical whipping boy for this - none of the self-maintaining performance stuff (prefetching, or the prelinker) actually works for longer than about six months, meaning that an XP installation starts off fast, gradually gets faster, and then rapidly slows down as the system tries to speed itself up.

  9. Blogspam by bziman · · Score: 5, Informative

    The submitter is the author of the blog, and is merely paraphrasing the whitepaper written by the author of the software -- and that is two years old. Nothing new or interesting here, just someone trying to draw eyeballs to his blog.

    1. Re:Blogspam by xenocide2 · · Score: 4, Insightful

      By doing something productive, not spamming me with shit I already knew about. Blog about new information you've generated. Maybe make some charts about disk head position during boot and demonstrate whether I/O is throughput or seek bound. Above all else, don't just copy someone else's shit and translate it into HTML.

      --
      I Browse at +4 Flamebait

      Open Source Sysadmin

  10. Re:What, what? by sqrammi · · Score: 5, Informative

    It's actually a little different than the preload that's been in Gentoo for years. The core functionality is of course the same, but now a daemon runs that caches libraries and updates the linkage periodically. So, it can possibly give much more performance, since everything is always up-to-date. It will be standard in Hardy Heron when it comes out.

  11. Re:What, what? by Anonymous Coward · · Score: 5, Interesting

    SuperFetch was one of the first things that I had to disable in Vista. I had downloaded a linux distro (a large .iso file) using Firefox, and for the next two weeks, everytime I rebooted my computer I would have to listen to my hard drive chug away for the next 10 minutes while it loaded the file into memory. (The new resource monitor in Visa is nice -- that is what helped me track down the problem).

    My computer is MUCH faster now that SuperFetch is disabled. Like night and day.

  12. Similar? by jsse · · Score: 4, Funny

    Preload is a Linux daemon that stores commonly-used libraries and binaries in memory to speed up access times, similar to the Windows Vista SuperFetch function I might be wrong, but similar function in Windows Vista should be "Reload".

    Vista users respond positively toward the speed boost everytime we "Reload" their Vista. The downtime and data lost as a result of "Reload" might irritate some disgruntled users, but most of them enjoy the free break at the expense of the company.

    Nothing in those Linus thingy could beat that user satisfaction. I might be bias though.
  13. Re:What, what? by EvilIdler · · Score: 5, Funny

    And what do you call the first time it works properly and reliably? Fantasy.
  14. Re:Security Implications? by janzen · · Score: 4, Funny

    Only if you run out of cold spray.

  15. Re:What, what? by metalhed77 · · Score: 4, Funny

    I'm envisioning a sensible sort of preload program in gentoo right now:

    *Preloading commonly used data, libraries, and binaries...
    gcc OK
    make OK
    libc-dev OK ... *snip* ...
    emerge OK
    kernel-src OK
    *Preload done, 3827K of USE Flags, 2TB of source code, and one compiler, and firefox to surf forums.gentoo.org for better use flags while you compile loaded into main memory

    --
    Photos.
  16. Re:What, what? by Spy+der+Mann · · Score: 4, Funny

    In Linux, most things never reach the x.0 stage, no matter how mature they are.

    This reminds me of a geek girlfriend I had... she told me she was 29.9.9.12.1 years old. But when I met her in real life, i was suprised she had a daughter... 17.1.25 years old!

  17. Re:What, what? by Jah-Wren+Ryel · · Score: 4, Insightful

    You mean Linux adapted something from Windows instead of the other way around? Fundamentally, preload and superfetch are just gussied up versions of the sticky bit which I am sure wasn't unique to unix back in the 70s either.
    --
    When information is power, privacy is freedom.
  18. Difference with readahead? by pieleric · · Score: 4, Interesting
    Currently I use readhead which, at boot time, basically uses a special linux syscall to tell the kernel to read some files ahead whenever it has nothing else better to read.

    Does anyone knows the difference between the two projects? Does preload have a better algorithm for selecting the files to read? Does it also use this special syscall?