In order to speed up JBoss startup and use, I copied the contents of my <jboss-home>
dir to a big enough tmpfs
'disk'. With this, I was expecting significant speedup.
However, to my surprise, I saw not one bit improvement - neither in startup time, nor in subsequent application use.
How I created tmpfs
?
$ mkdir /usr/local/tmpfs-disk
$ mount -t tmpfs -o size=2048m tmpfs /usr/local/tmpfs-disk
$
$ cd /usr/local
$ ln -s tmpfs-disk foo
$ ls -ld foo
lrwxrwxrwx 1 root root 9 Jul 21 00:09 foo -> tmpfs-disk
$
$ cp -a <jboss-home>/* foo/
Verification
$ mount
...
tmpfs on /usr/local/tmpfs-disk type tmpfs (rw,size=2048m)
$ df -h
Filesystem Size Used Avail Use% Mounted on
...
tmpfs 2.0G 1.3G 785M 62% /usr/local/tmpfs-disk
I'm using Fedora 12.
What am I missing here?
TIA...
Either you're not actually using the tmpfs (probably because you're not actually running the copy of your app that you copied to the ramdisk, but there are other possibilities I'll let you explore), or your performance bottleneck wasn't disk in the first place.
Modern OSes are actually pretty good about caching stuff in RAM. The best way to make sure is to force clear the cache (from another stack overflow: sync && echo 1 > /proc/sys/vm/drop_caches) and then the startup (and really only the startup) will be faster.
Try and check with vmstat is your memory is being swap out to disk.
If it is, then you can try to tune your fedora kernel vm.swappiness value. By default on RHEL is 60. Try change it to zero.
That kernel parameter decide how aggressively memory pages are swap to disk.