PDA

View Full Version : Linux - Improve EQ File Caching


codeboundfuture
05-26-2011, 11:21 AM
Up until now linux has never kept Everquest fully cached in the RAM and has always relied on loading files from the hard drive every time I reload or change zones. The solution I found is to use a formatted file mounted as a loop device, I'll explain briefly how to do the same for those who are interested.

The more ram you have and do not use the more effective this will be. For myself, without doing file copies, having any torrents open and ample amounts of untouched RAM, Everquest will only loads once from the hard drive and remains in memory. I expect good results from a computer playing everquest with even 512-1GB of RAM (Without file copy and torrents).

Be warned though that the use of the `dd` tool can be harmful. Be careful what you type, check twice and run once.
If you have issues check the 'You might want to' section at the bottom of this post.

Any feedback good/bad toward this guide or method is appreciated.

First we will need a file large enough to hold all of our EQ files. I made mine 3GB. I have room to spare on my hard drive and you will not cache the extra blank space in your RAM, since Everquest will never request that it be read.
dd if=/dev/zero of=Everquest.ext2 bs=4000 count=780000
This creates a file to use as a hard drive image. The size is {bs} * {count}. bs is block size in bytes.

Now we need a filesystem, I chose EXT2 for a lack of journaling and low overhead.
sudo mkfs.ext2 Everquest.ext2
You should see the following. This is expected. Check the details and confirm with a 'y'.
Everquest.ext2 is not a block special device.
Proceed anyway? (y,n) y

Now mount your newly formatted image as a loop device. I have a directory already made at '/mnt/everquest' for this purpose.
sudo mount -o loop Everquest.ext2 /mnt/everquest

Copy your everquest files into where you have mounted Everquest.ext2
cp ~/Games/everquest/* -Rv /mnt/everquest/

You may now run everquest from it's new location.


If you have spare RAM you should find that you only need to load zone files once from the hard drive, they will remain within your RAM until cache pressure pushes them out. (This depends on how much RAM you have and how much you use. Large file copies can alter your file cache as well as torrent {uploads} possibly)


-------
You might want to.....
-------
Make sure that you have permissions to write into '/mnt/everquest' (or it's equivalent).
Make sure you use the commands I use, unless you wish to change locations of certain things, be sure you keep up with those changes, these are YOUR files at risk.
Add Everquest.ext2 to your fstab to mount on boot or for faster mounting via the shorter command `mount /mnt/everquest`.

Enjoy, let me know how it works.