Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×
User Journal

Journal rwa2's Journal: Using readahead to speed up disk loading times of any application

Here's a way to get a list of files read by any application, so you can use readahead to preload those files optimally from disk:

CMD=firefox
strace -fe open $CMD 2>&1 | sed 's/.*open("\(.*\)".*/\1/' > $CMD.preload

# you can sift through that $CMD.preload file to look for things that don't belong

readahead $CMD.preload # preloads all those files into cache

time $CMD # should now start quite a bit faster, without much disk activity

## to clear disk cache as root (useful for testing / benchmarking)
echo 3 > /proc/sys/vm/drop_caches

If it works, you might want to append the contents of the .preload files for your commonly-used apps to /etc/readahead.d/default.later , so they are automatically loaded on startup (RAM size permitting)

This discussion has been archived. No new comments can be posted.

Using readahead to speed up disk loading times of any application

Comments Filter:

The use of money is all the advantage there is to having money. -- B. Franklin

Working...