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."
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.
What are the security implications of this?
I read a guide on the Gentoo forums a while ago about copying different directories into ram to "preload" them.
http://forums.gentoo.org/viewtopic-t-296892.html
I never actually tried it, but I might now that I have 4gb ram! A daemon to help automate this process would be welcome, though.
You mean Linux adapted something from Windows instead of the other way around? What's next, a sane proactor i/o api?
Joking aside, this is cool. You can be mad at Vista for a number of reasons, but SuperFetch is not one of them - I have noticed a decent speed improvement because of it, and look forward to having something similar in Linux. Glad to see people aren't above taking the good ideas from Windows (or wherever Microsoft stole it from, if that's the case).
I find it odd that the article "highly recommends" (RTFA before replying) installing this on a desktop Linux machine, but Vista's implementation is seen as "RAM hogging" and considered "bloat." I'm curious what sort of logical argument underlies this, as the "goodness" of preloading seems to change based upon which operating system it is implemented in. It is *almost* as if there is no logical basis, but, surely that can't be the case with the erudite, level-headed Slashdot crowd, right?
This seems an odd article given preload made it into distros as a standard component for Fedora Core 1 (RHEL3). Its been around since the late 2.4 kernel series was still mainstream. What was the significance of the article? It didn't even update the numbers to a modern hardware config.
it doesn't make GNU/Linux as *fast* Microsoft Vista.
Is this functionality available in Apple's OS X?
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.
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.
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.
I have a pretty good amount of memory on my current machine - 2Gb - and I mostly just never close any applications, especially with the big ones like Gimp just reusing the already open instance when you open a new file. I suspect that preload would not actually be all that useful for me in practice; I'm still goign to enable it to see if I'm wrong, though.
Trust the Computer. The Computer is your friend.
I'll say somethings not right there, I loaded Puppy on a 1 Gig USB drive, and tried it on my 7 year old homebuilt, and it was way slower than even XP.
Jerky mouse, freezing up, crashing, it brought back the days of Win98SE.
I thought it was because the USB load was "experimental".
I'll try DSL, or some other lighter weight distro and see what happens.
If it don't GO... chrome it. ~ Frank Banks
Hasn't unix done this for quite a while (decades) with the sticky but? Or did that just appply to programs?
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?
And then you go and run Gnome on it...
Deleted
Linux do cache all requests to the disk so I really don't see why you would need to use toram to get more speed. The only thing I can see is the ability to use the DVD drive. Sure seek times during boot are going to be eliminated, but you can do a precache stage in the boot instead.
But I always have wondered does linux cache the compressed blocks, or the uncompressed?
As far as I can tell, Kubuntu 7.10 has readahead installed by default. I can't find much information on whether preload is to replace that, or if they work together or what.
Has anyone got any insight into what's better, or if they will peacefully work together? I'd prefer faster app times over faster boot times as I hardly ever reboot.
"If you make people think they're thinking, they'll love you; But if you really make them think, they'll hate you." - DM
tried it out on my little eeepc and it definitely made a difference, on average its sped up all loading times by about 30 percent. This is especially good because i upgraded to a 2gig stick of ram but most programs hardly need that much ram and on average im left with about 1.2 gigs just sitting there doing nothing, now the ram is more productive and the loading time is noticably faster eg. firefox on a cold start without preload took 10 seconds to load before, now on a cold start it loads in 6 :). Also since the cpu is relatively slow it means fetching data and the overhead of moving it around it cut down alot. I'd love to shake the creators hand for this plucky little piece of software :) thanks!
Sounds like 7 years ago you had no idea how to build a decent computer...
I thought read ahead caching in the hard disk would have accomplished 90% of what this does.
I guess being smarter is more beneficial than I had thought
-- Programming with boost is like building a house with lego. It's a cool but I wouldn't want to live in it
Wanna give me a quick howto on doing this on the EEEPC? I'd love to do this with mine .. any particular gotchas?
; -- the corruption of government starts with its secrets. a truly free people keep no secrets. --
You could do it in the kernel, but you shouldn't. The kernel keeps track of files using inodes and device numbers, not paths, which may be volatile between reboots (udev+kernel can dynamically assign device numbers to kernel devices, filesystems are identified and mounted by scanning for UUIDs or labels in superblocks, etc). A tracking daemon can monitor system calls and keep a small database with logical paths, access patterns, and so forth; the user-space view of activity tracks intent better so the statistics can be more meaningful.
Moreover the act of caching the file is easily accomplished by a low-priority user-space task which speculatively reads the files which may be referenced soon. In this fashion the kernel memory manager does not need to be changed in any way; we are not creating a new kernel memory pool which would need new logic under memory pressure. In the case that RAM is suddenly needed for storing application pages or an unexpected demand-loaded program binary or library, we can flush these buffered files just like any other cached file; it's not treated any differently. It's just a daemon touching files (with the hope of a benefit in startup times of applications that require them).
THIS THING CAN TURN ON A DIME, MACROSSZERO STYLE ALSO FUCK BETA, ~NYORON
A little bird told me that Amazon (I think) had a kernel patch for this problem, because they were running Linux servers that got big files uploaded to them which would then not be touched for ages, and they didn't want them being cached.
Sorry, the little bird didn't tell me the patch name. But it's not a new problem, and a solution does exist.
In a few years we'll all be using solid state drives, anyhow. With 10,000x fetch rate, who'll know the difference? At that speed it makes me wonder when ram will be phased out completely. What's that, you say? Fewer parts, lower overhead, less environmental impact, and smaller form factor all for the cost of a few ms access time I'll barely notice anyways? Sounds like a good deal to me.
"Sounds like 7 years ago you had no idea how to build a decent computer..."
Sounds like you're quite an arrogant asshole...
If it don't GO... chrome it. ~ Frank Banks
So when its cached in "memory", does this mean virtual memory (possibly swap- as if with the long-existing and well-known sticky-bit under other OS's)???
Note the 379M number. That is the amount of data read from disk and kept in ram. When an application needs to malloc and no completely free memory, yes it will free up those pages (it ideally picks the cache least likely to be needed again). But absolutely, disk contents are kept in disk cache, but only after load. And no, memory leaks aren't hopelessly pervasive.
What preload does normally happens implicitly during boot. It's hard to demonstrate on init scripts effectively, but log into gnome right after boot, and the disk will thrash like crazy. Log out, kill every last process of that user, log in again. It will be quite dramatic. preload aims for that subsequent experience without the pain of the first.
So what preload brings is simple, and all that has to happen is simple, know which files are relevant to typical usage ahead of time, and be aggressive about 'cat file >
Linux implicitly aids this, but the user interface side still subjectively 'feels' bogged down because it won't proactively load things it doesn't know you'll need, despite the ability to derive this historical data in user space. If preload takes idle time (let's say, for example, while services with arbitrary sleeps and while waiting for username and password) and proactively gets cache populated, it is more IO work in the aggregate (disk will be hit up for things that will never be needed), but it will feel smoother out of the gate.
XML is like violence. If it doesn't solve the problem, use more.
As fun as it is to poke fun at MS for updates incurring reboots, most modern distros end up issuing a kernel update every couple of weeks, so linux is not immune. Also, I have some misbehaving drivers on my laptop that currently preclude suspending, and thus shut down when I have to travel with it, so it's often the case my linux laptop incurs resets that flush cache. Finally, the simple reality is if you want to build a platform for the masses, you have to deal with some users that even with everything lined up to avoid cache-dropping reboots, will want to shut-down or reboot because they feel like it (or know suspend on their particular hardware still draws a few watts, and want to save that). OO.o whether you like it or not is a significant piece of that equation as it has the largest mindshare among the free suites, afaict. As much as I find it critical to use pipes in the shell to make use of various programs, it's not something I relish trying to explain to a complete novice.
Meanwhile, if you close the app every time without rebooting, you won't be so bad off in the case that preload aims to help. Firefox starting once induces it's disk needs to be cached, starting it again should have a high disk cache hit rate. Leaving the app open just to avoid an eventual startup penalty can be a waste of memory and work against performance if you starve memory available for disk caching.
XML is like violence. If it doesn't solve the problem, use more.
Cowardly troll boy said: "Sounds like those things aren't mutually exclusive."
Thanks for sharing that it runs in your family, but we all can surmise that from your callow comments.
If it don't GO... chrome it. ~ Frank Banks
You could bugfix the two-year-old software, do a release on SourceForge, announce on Freshmeat, and THEN post on Slashdot. I bet that would not only boost readership, but it would be a readership that appreciated your efforts. All it would take is a relatively minor bugfix to be a real release. Run splint over it, or put it through dmalloc, fix compiler errors for gcc 4.2, or a dozen other things. A few minutes work, perhaps.
It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
AmigaOS booted as quickly as it did from floppy disk because the core elements of the kernel were in ROM, along with some key services. Mind you, Amiga learned a few tricks from UNIX.
no gotchas if you are using ubuntu or eeexubuntu, just follow the instructions on the preload homepage.
Even if very strictly only talking about reboots that go to firmware, depending on your system and what kernel you are changing from/to, the new kernel may do something odd like hang or some hardware/driver interaction might get confused by the situation (if the driver was unable to unload, and so the case of two driver loads coming without a driver unload or intermediate firmware initiation confuses some set of devices gravely, a few instances to the point of panic). As far as I can tell, most common cases kexec works well, but it isn't universally safe even if every driver is unloaded and precautions are taken before the change.
/boot on some trivially accessed media (i.e. a USB key) and / could be on any number of inconvenient devices for the firmware to get at. I just think the frustration system firmware is blown way out of proportion, and instead of insisting of doing away with it, demand features that facilitate things like fast boot and exotic boot loader configurations. A BIOS that would skip straight to a USB port (making all the relevant assumptions along the way) and go would go a long way paired with a USB flash storage device.
But I wouldn't dictate avoiding firmware as being *that* significant, *particularly* on desktop platforms with relatively fast BIOS. From a user convenience factor, kexec still means the entire process space/memory/everything goes away. You start init over again with a new kernel and initrd, just like you would from grub. It's not exactly a consolation that a kernel update will not get you into firmware if it still resets everything your doing like a full system reboot would. I can see with some card firmwares being annoyed with startup time, but it's generally not that bad. If really disconcerting, a number of cards/BIOSes let you disable the firmware for the card and the linux driver will still work, you just need
XML is like violence. If it doesn't solve the problem, use more.