1

I want to pre-load some Files / Programs into the memory, ram, cache to open / access them faster.

I already tried creating a tmpfs, ramfs System https://wiki.ubuntuusers.de/RAM-Disk_erstellen (Sorry its in German) by calling those commands for Example

sudo mount -t ramfs ramfs /media/ramdisk 
sudo mount -t tmpfs -o size=20% none /media/ramdisk

and put some data (arround 1GiB) in it.

I also tried pre-loading the Files directly Mount /usr in RAM (loading from HDD when starting, and saving to when shutting down) (top answer)

cat /bin/* /lib/* /usr/bin/* /usr/lib/* >/dev/null

or

ionice -c 3 find /bin /usr/bin /usr/lib* -type f -exec ionice -c 3 cat '{}' ';' > /dev/null &

but regardless what I’m doing I see no Ram Change via System Monitor / htop

Its always around 1,7GiB / 3,8GiB I’m running Lubuntu 14.10

Do you know of any limitations for doing so running a Ubuntu System or is there something else to do to archive what I want or am I missing some other important Point?

hypnomaki
  • 111
  • 2
  • 1
    Run `free -h` for detailed data about RAM usage. Notice the "cached" collumn – leorize Jul 22 '15 at 10:17
  • Here's the Output: 3,8G [total] 3,6G [used] 1,5G [cached] But why is "free" showing other values than htop? – hypnomaki Jul 22 '15 at 10:51
  • Just googled it by my self http://askubuntu.com/questions/369466/memory-usage-statistics-different-in-free-and-htop So i think you solved my question ^^ The only thing left to do for me is to measure the speed improvement now – hypnomaki Jul 22 '15 at 10:54
  • and also this is a good reference for this question.... so it is really all about how memory is actually counted... I totally missed that http://unix.stackexchange.com/questions/176309/tmpfs-creating-file-in-tmpfs-does-not-change-memory-usage-in-htop-top – hypnomaki Jul 22 '15 at 10:56
  • Glad you solved it yourself. I recommend using [preload](https://apps.ubuntu.com/cat/applications/preload/) instead of manually load every libs and binary to RAM. Preload can profile your usage and select binaries and libraries that you often use and load them to RAM automatically – leorize Jul 22 '15 at 11:50
  • I've been running preload for a month but could'nt measured big differences..... also thought about using prelink since its more configurable but never tested it so far. do you know about prelink? – hypnomaki Jul 22 '15 at 12:06
  • You could read about it from [the Arch Wiki](https://wiki.archlinux.org/index.php/Prelink). HDD and CPU nowadays are fast enough so that differences are negliable. I suggest reading [Maximizing Performance](https://wiki.archlinux.org/index.php/Maximizing_performance) if you want to increase your PC performance – leorize Jul 22 '15 at 15:44

0 Answers0