Sunday, January 4, 2009

Preload

Along with playing with the 64bit os this weekend, I decided to mess with sysctl.conf and preload again.

For those who do not know /etc/sysctl.conf controls your kernel parameters - it's a nice way to adjust your operating system's running kernel without rebuilding the kernel from source and preload is a program you can install via 'sudo apt-get install preload' which preloads dlls and binaries into memory. It watches which programs you use and trys to load parts of the program into memory so when you launch the program it runs faster.

Still trying to find the best ratios for performance. I really like preload but you have to tweak it out a bit and also tune your system to be a little more aggressive with virtual memory garbage collecting via sysctl.conf. Preload obviously would not be too beneficial in a server environment but on the desktop it does make things pop up faster.

The whole test was to see if I could really shave openoffice and firefox launch times. And preload worked very well after I tricked out my sysctl.conf file.

Here are some of the changes I made in /etc/sysctl.conf
vm.swappiness=15
vm.vfs_cache_pressure=50
net.core.rmem_default = 256288
kernel.shmmax = 268435456
net.core.optmem_max = 57344
kernel.threads-max = 16379
fs.file-max = 16384
vm.page-cluster = 3

Then I adjusted my /etc/preload.conf
minsize = 1500000
memtotal = 30

Openoffice and firefox both noticiably increased in launch times. I don't have too many firefox extenstions but it does take a couple seconds for it to pop up - with preload and my new sysctl it comes up almost instantly. Openoffice runs faster also, it loads in about 10 secs and then each load afterwards is like instant. For Openoffice I changed some settings in it's preferences also, I increased the memory Openoffice could use to 64MB so it can load more of itself in the background. Now both come up fast.

2 comments:

Network23 said...

How many MB Ram do you have in your setup?
its very useless if somebody has a different config

Antonio Sosa said...

Hi Network23. Thanks for posting a comment. I am building LAVA with the intention of running on a computer with 2 GB or more of RAM. The original idea was to have it run lean and I original omitted preload and even after the 2nd build when I decided to add it in I originally had the config file had a min of 256mb allocated but over the last 2 years, all the workstations I have to support have 2gb min with more increasing coming with 4 gb ram standard. In fact, it is becoming such a standard I am actually thinking of changing the LAVA OS Base system to a 64bit system as the time of the 32 bit era at least for my supported platforms is coming near it's end.

As far as preload is concerned I find it really just affects the application launch time. IT cuts a small amount of time when the user actually double clicks on a app. Usually this tradeoff means a slightly longer load time to get to your desktop as the supporting files that make up the app are loaded in ram during the boot phase. The importance of which is debatable depending on if you are a person that wants a faster boot or a faster app launch. I am the later as I find I leave my system on and want my apps to launch faster.

It's funny cause on Window installations I absolutely hate having preloaders like the Adobe quick launch automatically loading :) So much so that I just use foxit. I recommend it to anyone just needing a pdf reader and not all the fancy bloated code in the recent versions of Adobe's pdf reader.

Again - as with anything else - if you prefer not to have preloader you can simply apt-get remove it :)

I find on the workstations, the users appreciate it and regard it as something which gives them instant relief and satisfaction. It gives them the illusion their system is faster than it is.

Thanks - if you think the preload limit I set is too high or you think it's a waste of silicon space, shoot me a comment - the preload debate as it is evident on my blog is ongoing :)

I usually remove it from server installs as I would rather ram be put to use besides making an app launch quicker. : )