9 ms·
3x faster linux boot with e4rat
- johnhartigun 14y agoDoes the debian package work in Ubuntu?
- diggan 14y agoYes, you might need to remove ureadahead though.
- deleted 14y ago[deleted]
- diggan 14y agoGood tutorial about how to use e4rat: http://www.howtogeek.com/69753/how-to-cut-your-linux-pcs-boot-time-in-half-with-e4rat/ http://www.howtogeek.com/69753/how-to-cut-your-linux-pcs-boo...
- hamoid 14y agoWould it make a difference with SSD drives?
- diggan 14y agoNo, it moves the files used in the startup to a closer sector and won't speed up your booting time if you're using SSD discs.
- rbanffy 14y agoBy placing the files together in the memory you may get some extra performance, but it depends on how your SSD is internally organized - you may have some locality effects if the drive pre-fetches more than the block you called for into a cache faster than the flash memory.
- jeltz 14y agoSequential reads are faster than random even on SSD drivers, so it could help but I am not sure how much.
- Iv 14y agoOh ? Why is that ? SSD still need to address every memory block, don't they ? Or do they have a faster DMA-like mode where you can send the instruction "give me the next 96KB starting at address X ?
- lucian1900 14y agoSSDs exhibit the same sort of cache locality RAM does. When a region is accessed, a larger chunk is fetched and cached just in case it's needed later.
- nuje 14y agoYes, and the OS readahead also helps. You can see the random vs sequential difference in any ssd review, eg http://thessdreview.com/our-reviews/ocz-vertex-3-240gb-max-iops-review-as-ssd-tests/ http://thessdreview.com/our-reviews/ocz-vertex-3-240gb-max-i... shows 18 MB/s in random reads vs 500 MB/s sequential reads.
- diggan 14y agoI'm not sure if a SSD drive have any moving parts and therefor will not benefit from E4rat.
- wtallis 14y agoWith an SSD, the bottleneck for booting is usually hardware detection and initialization, not reading data off the disk. My system takes about 4-5 seconds from the time the bootloader hands off control to the kernel to the time the kernel starts executing the initrd, and another 6-7 seconds to mount the SSD and hard drive, establish the network connection, start system services, and present a login prompt (though starting X and changing resolutions takes another second or two on top of that). I probably can't make that more than 20% faster without getting a faster DHCP server or tweaking various delays and timeouts that exist for good reasons.
- dwc 14y agoLaptop: open lid and resume. Server: RAID startup dwarfs OS startup. Does super fast booting matter much these days? It's just about ceased to matter to me completely.
- acabal 14y agoLinux still has lots of problems with suspend/hibernate/resume on laptops (Oneiric broke hiberanate on my laptop for example), so booting is still kind of important for that reason. Resume from hibernate is another area where I'd like to see improvements. I hibernate instead of suspend because I never know if I'll make it back to an outlet in time.
- javert 14y agoSounds like a problem with Ubuntu, really, not Linux.
- ebiester 14y agoIt's more of a problem with hardware more interested in coding to "works on Windows" than "complies with spec." And honestly, Startup is as fast as resume these days - the problem is applications that don't remember last known state and window managers that won't remember the rest. Why don't we fix that instead rather than chasing down all the suspend bugs?
- mbq 14y agoRestoring app last state? Like terminal emulator recreating tmux session wrapping screen session with package manager working under sudo? SSH unHUP-ing processes on remote machine? Python VM resuming all scripts in a precise place and state they were stopped? The problem is that there is no such thing as isolated "application" on Linux or any other real OS.
- jmah 14y agoRestoring is hard. Let's go shopping!
- derefr 14y agoIs this similar to OSX's Hot File Adaptive Clustering, then?
- obtu 14y agoThe OSX feature apparently notices files which are slowly appended to (downloads) and defragments them. It does not reallocate a set of files (such as the ones touched at boot) to be adjacent on disk, which is what e4rat does.
- driverdan 14y agoIt's an interesting project. I wish we had it 5+ years ago when it mattered. The only place I'd use a spinning disk as my primary drive is on a server and that's something you rarely boot. If you're not using an SSD skip a month of Starbucks and buy one. Disk IO is far and away the biggest bottleneck for most users. An SSD will increase your productivity profoundly.
- Danieru 14y agoI did buy one, then it broke. Once you factor in the re-installs the latency of spinning rust looks a bit better.
- mdonahoe 14y agoMy SSD makes for a nice drink coaster.
- Karunamon 14y agoDon't buy garbage SSDs, and make sure your system is utilizing them correctly. Putting swap on an SSD = horrible idea.
- reitzensteinm 14y agoIt's not a good idea for an MLC drive, but a decent SSD should fail into read only mode when enough sectors are lost.
- Danieru 14y agoIt wasn't even the flash that failed, the controller stopped my bios from posting until the sata polling timed out. Yes it was a cheap SSD, but the difference between the high end and low end should be performance. Not "breaks vs !break". When that is true I'll buy another SSD. That is not to say that SSDs are "bad", they are just not for me, yet. I like my computers to be low maintenance. I stopped fiddling with hardware for performance a few years ago.
- 14y ago
- sciurus 14y agoNote that if you're using Ubuntu you're using ureadhaead, which does something similar to minimize seeks during boot. https://wiki.archlinux.org/index.php/Ureadahead https://wiki.archlinux.org/index.php/Ureadahead
- rcthompson 14y agoThen why are there deb files for Ubuntu? I don't think they're doing exactly the same thing, since e4rat is using specific features of the Ext4 filesystem. Edit: Actually, the directions say to remove Ureadahead when installing e4rat, so maybe they are quite similar.
- yason 14y agoAFAIK, ureadahead just keeps track of which files/blocks are touched during bootup/startx and pre-reads them into a cache at the very beginning of the boot sequence so you will effectively boot from cache. This still requires seeking to several semi-random areas of the disk while prereading which e4rat is fixing by physically moving the needed blocks adjacent to eachother.
- deleted 14y ago[deleted]
- sciurus 14y agoFor some reason, I had the idea that ureadahead's pack files actually contained the contents of the blocks that needed to be read during boot, turning readahead into a sequential operation. After reading the manpage today, I see that I was mistaken.
- ntoshev 14y agoIt would be nice if someone installed e4rat on Ubuntu (with ureadahead) and reported the performance.
- obtu 14y agoSince ureadahead looks at blocks and not files, it has a potential speed advantage if the boot process is opening some large files but not reading them in full. Edit: except the ureadahead packfile only points to the blocks and files, it does not provide a way to inline them. So e4rat is almost certainly faster. It's a shame it is ext4 specific. Apparently Scott James Remnant, the ureadahead developer, considered feeding the collected info to a defragmenter: http://ubuntuforums.org/showthread.php?t=1434502 http://ubuntuforums.org/showthread.php?t=1434502 ; this would be nice, as it means a single package is responsible for the feature, and filesystems perform to the best of their ability whether or not they have ext4-like fine-grained control of defragmentation.
- hello_asdf 14y agoThe easiest way I've found to increase boot speed and application load even under heavy system load is to use the pf kernel patchset. With a properly configured kernel using BFS, BFQ, and LZMA compression, my system is amazingly fast. Even when compiling and both cores at my laptop are at 100% my system is fully usable. If you have a Macbook Pro my kernel configs are here: https://github.com/meinhimmel/kernel-configs https://github.com/meinhimmel/kernel-configs
- dneb7 14y agoI saw a demo of this at Intel Labs on a Windows machine about 15 years ago and it was very impressive. I don't think they optimized startup, but application launch was incredibly fast with their disk layout optimization. Isn't this essentially what DiskKeeper does on Windows?
- maaku 14y agoI don't know about DiskKeeper, but I believe it's part of the "Lenovo Enhanced Experience" on ThinkPads. Amazingly, my factory install with crapware booted from pressing BIOS to Windows desktop in just over 7 seconds. I haven't been able to get my clean install below 10 seconds, I think because I'm missing the filesystem tweaking.
- ThePinion 14y agoJust did this on an old Inspiron 1545 with Ubuntu 12.04 on it and I'm already noticing major improvement in both boot time and the apps I open frequently (also with the help of preloader and zram) I followed this guide: http://www.howtogeek.com/69753/how-to-cut-your-linux-pcs-boot-time-in-half-with-e4rat/ http://www.howtogeek.com/69753/how-to-cut-your-linux-pcs-boo... Although note, at the part where it says push CTRL+ALT+F1 to get to a new terminal login, that didn't work for me. I had to go to the default one (CTRL+ALT+F7) and type "logout" and then go to CTRL+ALT+F6. I have a web page I keep track of common things I do to my Ubuntu installs (shameless plug: http://ubuntu.mindseeder.com http://ubuntu.mindseeder.com) and I'm definitely going to add this so I don't forget!
- obtu 14y agoI wonder how much improvement that brings over standard ureadahead (see yason in this thread for how they differ). For zram, no need for a ppa, a zram-config package has been added in precise.
- yason 14y agoTen years ago, BeOS booted in ten seconds without any special tricks. That was on late 90's and early 00's hardware. Certainly it didn't access hundreds of megabytes of libraries and files in order to boot as a modern Linux does, but it was also specifically designed that way even by the contemporary standards. And don't get me started about the 16-bit era... Machines were slower then but using them was generally faster.
- rbanffy 14y ago30 years ago, my Apple II booted into a REPL in less than one second. 3 if you needed disk support. And that was on a 1 MHz 8-bit processor. There were people who could toggle a bootstrap loader into an Altair in less time than a modern x86 PC takes to boot.
- m_st 14y agoThat's why people love tablets and smartphones. You're much faster using them to check your mails or weather, etc than using a topnotch PC. [Now of course that doesn't include booting but when did you reboot your tablet or smartphone the last time?]
- moeffju 14y agoSo when will we see this in our smartphones? I don't understand and, frankly, find it ridiculous that I have to wait about a minute or up to 90 seconds for my smartphone to boot, a device that is completely flash-memory based and that has no variability in hardware. I still remember the article about that industrial Linux PC that booted in less than one second, including initializing video4linux and two cameras etc., simply by optimizing kernel parameters, boot order, and driver timeouts. That must have been 2005 or so. Now it's 2012 and my phone takes longer to boot than my laptop (late 2010 MBP w/ SSD).