Linux Stall
  • Home
  • Android
  • How to
  • Perl
  • Tips
  • Tutorials
No Result
View All Result
Linux Stall
No Result
View All Result
Home Tips

Drastically Speed up your Linux System with Preload

Chankey Pathak by Chankey Pathak
July 23, 2020
in Tips
52 0
0
conceptual image, methaphor of busy and fast business, man with airplane desk
17
SHARES
870
VIEWS
Share on FacebookShare on Twitter

Introduction

Preload is an “adaptive readahead daemon” that runs in the background of your system, and observes what programs you use most often, caching them in order to speed up application load time. By using Preload, you can put unused RAM to good work, and improve the overall performance of your desktop system.

Installation

Installing Preload on Ubuntu is easily done with the command:

sudo apt-get install preload

Preload is in the package repositories of many different managers, so users of other distributions should check their appropriate package managers to see if it’s available. If not, you can always install Preload via its page on SourceForge.net

Once installed, Preload will start, and no further action is necessary, but read on for configuration options, to learn how to monitor Preload’s activities, and see what kind of improvements Preload will bring to your system.

Configuration

The configuration file for Preload is kept in /etc/preload.conf and the default values should be fine for most people. But if you want to tweak the operation of Preload, an explanation of the options is available in the configuration file as well as in the paper written by its developer, Behdad Esfahbod.

Some common options available are:

Option Default Control
model.cycle 20 [seconds] How often Preload will query your system to update it’s model about programs and libraries to cache.
model.halflife 168 [hours] How often Preload will begin to “forget” about old data; for each halflife, the statistical relevance of the current model loses 50% of its importance.
model.minsize 2000000 [bytes] The minimum amount of system calls an application makes for it to be considered by Preload. A smaller number will mean Preload caches smaller applications, while to make Preload cache only larger applications, increase this number.

Memory Settings

The forumula used to determine the maximum available memory available to Preload is:

(Total RAM x model.memtotal) + (RAM available at start x model.memfree) + (Cached memory x model.memcached)

Default values:

  • model.memtotal -10%
  • model.memfree 100%
  • model.memcached 30%

As I noted previously, the default values should be fine for most people, and you really shouldn’t change these values unless you have a specific purpose in mind.

I’ve heard concerns about Preload’s RAM usage, so I want to make it clear that Preload will not drain your system memory! On my system with 1GB of RAM, preload has given itself 83670kb as it’s maximum available memory size; and of that, it’s only using 35% of that at the moment!

Monitoring

If you want to check up on what resources Preload is using, you can monitor its logfile by running:

sudo tail -f /var/log/preload.log

By default (you can manually set the verbosity of Preload with the “-V” flag; for more information, check Preload’s man page) this won’t tell you much information about Preload except for the amount of memory it has allocated and how many files it’s watching. If you want more information about the specific files that Preload is caching for you, look at this file:

sudo less /var/lib/preload/preload.state

The beautiful thing about Preload, however, is that you can ignore these files completely; you might want to check up on the log every once and a while, just to make sure that it’s running, but Preload will happily sit in the background and stay out of your way.

By the numbers

It’ll take a little while before Preload starts to understand your usage patterns, so don’t expect to see a drastic change in performance right away. Also, if you’re just opening/closing applications repetitively, your computer will store those files in cache anyway (this is called a “warm” load), so you won’t see any difference in speed there. You will, however, see a speed improvement if, for example, you use a program intermittently; these programs will startup faster than without Preload.

The author of Preload, Behdad Esfahbod, has written a paper in which he provides some sample figures for the speed effects of Preload:

Application “Cold” Startup Time Preloaded Startup Time % Improvement
Desktop Login 30s 23s 23%
OpenOffice.org Writer 15s 7s 53%
Firefox 11s 5s 55%
Evolution 9s 4s 55%
Gedit Text Editor 6s 4s 33%
Gnome Terminal 4s 3s 25%

Or, for those that prefer graphs to tables:

preload-benchmark

Keep in mind these numbers are not representitive of current hardware. Modern machines will probably beat the raw timing of these numbers in even cold-start times, but obviously will still see an improvement in speed with Preload (I wasn’t able to find any modern benchmarks to compare, but I imagine they will be similar in terms of percent of speed improvement).

As you can see, larger applications benefit more from Preload, although all applications do benefit at least a little bit. Since Preload is configured to start during bootup, even the amount of time it takes to login to a complete desktop is enhanced by Preload. Keep in mind these numbers were generated several years ago! Modern machines will probably beat these numbers in even cold-start times, but obviously will still see an improvement in speed with Preload! For more information, read the developer’s thesis paper.

Conclusion

Preload can provide a great improvement in application startup time; since most modern machines have a good deal of memory to spare, Preload puts this RAM to good use. I highly recommend installing Preload on your desktop machine, and although it may take a little while for the daemon to learn your habits before your see any real performance improvement, it’s a great tool that increases the speed of your system while staying in the background, out of your way.

Tags: free softwareopen sourceperformanceTips
Previous Post

Identifying and Resolving IP Address Conflicts with Linux

Next Post

Softlinks vs. Hardlinks: A Quick Explanation

Chankey Pathak

Chankey Pathak

Data Scientist at Morgan Stanley. I've been using Linux since past 12 years. I plan to share what I know about Linux in this blog.

Related Posts

Professional Developer programmer working a software website design and coding technology, writing codes and database in company office, Global cyber connection technology.
Tips

Writing A Basic Expect Script For Automating Tasks

July 12, 2020
The three-dimensional network topology infographics with ip addresses 3d illustration
Tips

Useful Remote IPMI Commands For Managing Servers

July 11, 2020
How to run sudo command without password on Linux?
FAQ

How to run sudo command without password on Linux?

June 21, 2015
Add auto-complete to “yum”
Tips

Add auto-complete to “yum”

August 18, 2013
How to display a digital clock in Linux terminal?
Tips

How to display a digital clock in Linux terminal?

September 20, 2012
random password from command line
Tips

Your own command line password generator!

February 17, 2012
Next Post
softlinking linux

Softlinks vs. Hardlinks: A Quick Explanation

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

  • Terms and Conditions
  • Contact Us
  • About Us

© 2012 - 2020 Linux Stall - A place for all your Linux needs.

No Result
View All Result
  • Home
  • Android
  • How to
  • Perl
  • Tips
  • Tutorials

© 2012 - 2020 Linux Stall - A place for all your Linux needs.

Welcome Back!

Login to your account below

Forgotten Password?

Create New Account!

Fill the forms bellow to register

All fields are required. Log In

Retrieve your password

Please enter your username or email address to reset your password.

Log In