Most Linux distributions are fast enough by default. However, we can still make them a little bit faster using some additional applications and methods. One such application we are about to see is Preload. It monitors the most frequently-used applications by the user and adds them to the memory, so that the applications will load little bit faster than before. Because, as you might already know, reading from the RAM is always faster than from the hard drive. Preload runs as a daemon on the background all the time and records the statistics about usage of files by more frequently-used programs. It then fetches those binaries and their dependencies into memory to improve the application loading time. In a nutshell, once preload is installed, you should be able to load the often-used applications much faster.
In this brief tutorial, we are going to see how to install and use Preload to improve an application startup time in Linux.
Improve Application Startup Time In Linux Using Preload
Preload is available in AUR. So you can install it using AUR helper programs in any Arch-based systems such as Antergos, Manjaro Linux.
$ pacaur -S preload
$ packer -S preload
$ trizen -S preload
$ yay -S preload
$ yaourt -S preload
On Debian, Ubuntu, Linux Mint, Preload is available in the default repositories. So you can install it using APT package manager like below.
$ sudo apt-get install preload
Once Preload installed, reboot your system. From now on, Preload monitors the frequently-used applications and adds their binaries and libraries into the Memory for faster startup time. For example, if you often use Firefox, Chrome or LibreOffice, Preload will then add those binaries and libraries into RAM, so those applications will start faster. Good thing is it doesn’t need any configuration. It will just work out of the box. If you, however, wants to tweak the configuration, you can do it by editing the default configuration file /etc/preload.conf.
Preload isn’t for everyone!
Here are some drawbacks of Preload and why it is not that effective for everyone, discussed in this thread.
- I do have a decent specification system with 8GB RAM. So my system is generally fast. Also, I will open heavy memory-consuming applications, such as Firefox, Chrome, VirtualBox, Gimp etc., one or two times per day. They remain open all the time, hence their binaries and libraries are preloaded into memory and occupying the RAM all day. I rarely close and open those applications, so the RAM usage is simply waste.
- If you’re using modern systems with SSD, Preload is obviously useless. Because SSDs access time is much faster than normal hard drives, so using Preload is pointless.
- Preload significantly affects the boot time. Because the more applications are preloaded into RAM, the longer it takes to get your system up and running.
You will only the see the real difference only if you’re reloading applications a LOT of time per day. So Preload will be ideal for the developers and testers who open and close the applications several times everyday.
For more details about what exactly preload is and how it works, read the complete Preload thesis paper submitted by the author.
And, that’s all for now. Hope this was useful. More good stuffs to come. Stay tuned!