Enhancing your SL Cache
|
Ron Overdrive
Registered User
Join date: 10 Jul 2005
Posts: 1,002
|
11-22-2005 08:27
One of the biggest issues I've seen with SL Caching system besides the fact it doesn't seem like its being used right is lag caused by transfer speeds between your motherboard & hard drive. So I came up with this little idea of putting SL's cache to a ramdisk (a virtual harddrive that exists in your ram) and gave it a shot. All I gotta say is WOW. Talk about a difference. So I feel I should share this with my fellow SecondLifers. Disclaimer: I am not resposible for any damages to your system due to user neglagence. Following this how-to you accept full responsibility for anything that occurs to your system including but not limited to system instability, system failure (crashes), or system corruption (damage to OS). Now that the disclaimer is out of the way we can get on with the how-to. Ok things you'll need: Windows 2000 or better (this includes WindowsXP, sorry Mac guys) Windows Server 2003 Resource Kit Tools (linkd.exe) RAM Disk software (I used RAMDisk XP) 512mb RAM (768+ recomended) First thing you'll need to do is download the Windows Server 2003 Resource Kit Tools if you don't already have it. LinkD.exe Now find yourself some RAMDisk software. There are a few free ones out there, but keep in mind we'll need one that allows you to make an NTFS drive. I used Cenatek RAMDiskXP wich you can find a 30 use trial (not bad if you're like me who only resets their computer like once a month). Now once you aquire some RAMDisk software make yourself a RAMDisk using the software you found. Now if you're using 512 - 768mb I'd recomend no more than 50 mb otherwise you hit some system performance problems, 768 you might be able to slide with a 200mb disk. Anything 1 gig or better you can set this to 200 - 500 since you got ram to spare. Now make sure this ramdisk is NTFS formated for best performance. Some RAM disks require you format it with Windows Disk Management before the drive becomes usuable as was my case to get it formated in NTFS. Now once you have your partitioned ramdisk its time to link SL's cache to the ram disk. EDIT: Here I'm gonna tell you where to get RAMDisk XP and how to configure it. Ok, first download RAMDiskXP here. Once downloaded and installed we're gonna make a ramdisk. When you first start up RAMDisk you'll see how simple this is gonna be. Where it says Disk Size enter the size of the cache you intend to use. Choose Unformatted and hit start RAMDisk. Now the drive won't be ready until you format the drive. To do that you'll need to enter Windows Disk Management. To do this goto Start -> Run. Enter "c:\windows\system32\diskmgmt" and hit enter. This will load up Disk Management. BE VERY CAREFUL HERE NOT TO DO ANYTHING BEYOND WHAT I'M INSTRUCTING YOU TO DO OTHERWISE YOU COULD RUIN YOUR SYSTEM. In the lower half of the window you should see partitions. You wanna look for the unpartitioned space on a seperate disk (note Drive C will be Disk 0, D Disk 1, etc.). Assuming you only have 1 harddrive then you will be looking for Disk 1. Right click on the empty space and choose Format. You will be prompted to assign a drive letter (I recomend Z). Make sure you choose Primary for the partition type. After you are done formatting exit Disk Management and the ramdrive should appear in your My Computer list of drives. Congrats you've created your RAMDisk. Now you must clear your cache and delete whatever wasn't cleared from the SL Cache director (usually found in c:\document and settings\<username>\application data\secondlife\cache where <username> is the name of the account that has SL installed). Now once thats cleared make a directory named cache on your ramdisk. Now here's another fun part: goto the command prompt. Start -> Programs -> Accessories -> Command Prompt for those who don't know. now enter the following command (note this is assuming Z: is the drive letter you chose for your ramdisk, Change Z: to your drive letter. Replace %USERNAME% with the propper username that has SL installed): C:\Program Files\Windows Resource Kits\Tools>LinkD.exe "C:\Documents and Settings\%USERNAME%\Application Data\SecondLife\cache" "Z:\cache" There, everything should be linked and fully operational. Enjoy the speed boost.  EDIT: keep in mind most RAM disks will be wiped clean apon system reboot. Some have the option of saving the ramdisk on shutdown/reboot. Unless the one you find has that option then I recomend you turn it on unless you don't mind recaching your inventory every reboot. Also each ramdisk is different wich is why I didn't go too indepth. I just whipped this up real quick for the tech savy amongst us to give it a whirl. I will do a reversion later on with a bit more detail using the ramdisk software I used.
|
Ferran Brodsky
Better living through rum
Join date: 3 Feb 2004
Posts: 821
|
11-22-2005 08:38
Not sure how that works so Im just speculating here...
Seems like it would speed up an SL session, but if you exit SL and or reboot your machine will you have to build up that cache all over again?
Seems like it could be good for people that tend to log in for extended periods if the above is an accurate guesstimate. But if you relog and reboot a lot it may actually take longer to re-cache all the time.
For me Im in SL for like 5+ hours when I do get a chance to log in, soseems like a good idea. I'm def. looking into it, Thanks for the heads-up Ron
|
Ron Overdrive
Registered User
Join date: 10 Jul 2005
Posts: 1,002
|
11-22-2005 08:45
No you only loose your cache if you reboot your machine and your ramdisk software doesn't have the option to save your ramdisk on shutdown. If your software, like mine, allows you to save the ramdisk on shutdown you'll never have inventory recaching issues. But most out there don't have that option. So the only ways you'll loose your cache is if you A) force clear your cache within SL or B) restart your system. Honestly clearing the cache every so often is probly healthier for your system anyways since SIMs are so dynamic you'll probly have excess textures just taking up space in your cache after a while.
|
Lora Morgan
Puts the "eek" in "geek"
Join date: 19 Mar 2004
Posts: 779
|
11-22-2005 09:30
Seems like a good idea for me, considering I rarely reboot my computer. Anyone have any ideas on getting this to work on OSX? There are several RAM disk programs out there, but what about setting SL to use it as your cache?
|
Newfie Pendragon
Crusty and proud of it
Join date: 19 Dec 2003
Posts: 1,025
|
11-22-2005 10:14
From: Ferran Brodsky Not sure how that works so Im just speculating here...
Seems like it would speed up an SL session, but if you exit SL and or reboot your machine will you have to build up that cache all over again?
A RAMdisk is a piece of software that creates an artificial 'disk' that exists purely in memory. Becuase it exists only in memory, it is generally orders of magnitude faster than a physical disk could ever be. The benefits of a RAMdisk are obvious - sheer flat-out speed. There are downsides though, the biggest one being that for every MB of space you reserve for your RAMdisk, that's one MB of memory you have available to run software. Also once the power is turned off, *poof* - all contents of the RAMdisk is gone. This RamDisk XP sounds interesting though, and SL's cache sounds like a prime candidate to benefit - will definitely be checking it out! - Newfie
|
FlipperPA Peregrine
Magically Delicious!
Join date: 14 Nov 2003
Posts: 3,703
|
11-22-2005 10:22
Wow, what a cool idea, and also probably good for the machine; less hard disk use = less heat generated. I'm going to look into this and see how it can be easy maintained across reboots!
Thanks!
-Flip
_____________________
Peregrine Salon: www.PeregrineSalon.com - my consulting company Second Blogger: www.SecondBlogger.com - free, fully integrated Second Life blogging for all avatars!
|
Harris Hare
Second Life Resident
Join date: 5 Nov 2004
Posts: 301
|
11-22-2005 10:28
After a little searching, I found the following free ram disk software for OSX. I'll give it a try tonight and see how it goes. http://www.macupdate.com/info.php/id/16518
|
Margaret Mfume
I.C.
Join date: 30 Dec 2004
Posts: 2,492
|
11-22-2005 10:28
From: Lora Morgan Seems like a good idea for me, considering I rarely reboot my computer. Anyone have any ideas on getting this to work on OSX? There are several RAM disk programs out there, but what about setting SL to use it as your cache? I second the request for OSX support.
_____________________
hush 
|
blaze Spinnaker
1/2 Serious
Join date: 12 Aug 2004
Posts: 5,898
|
11-22-2005 10:30
NT/XP already does a lot of predictive caching. You're not going to find too much of a speed up over just having lots of ram.
This sort of thing is useful for stuff that you want to load up quickly that you have not been using for the last little while.
For example, if you've been in SL for an hour and then you want to load up photoshop real fast.
_____________________
Taken from The last paragraph on pg. 16 of Cory Ondrejka's paper " Changing Realities: User Creation, Communication, and Innovation in Digital Worlds : " User-created content takes the idea of leveraging player opinions a step further by allowing them to effectively prototype new ideas and features. Developers can then measure which new concepts most improve the products and incorporate them into the game in future patches."
|
Eggy Lippmann
Wiktator
Join date: 1 May 2003
Posts: 7,939
|
11-22-2005 10:36
Whoa, are you serious about the performance improvements? AFAIK, SL is supposed to use as much RAM as you've got... and only hit the disk cache if its not in memory yet. I guess if the disk access is slowing things down maybe the cache should be disabled altogether.
|
Ron Overdrive
Registered User
Join date: 10 Jul 2005
Posts: 1,002
|
11-22-2005 10:48
SL is suppose to use as much ram as possible, problem being it really doesn't. From what I've seen it uses around 350mb at best. Out of the 1024mb ram on my machine, if all I have is SL + WinXP + Trillian + Firefox running (wich is normal for me), my system doesn't use more than 650mb of my available Ram. Honestly LL should add in a feature to load more textures into ram for machines that have more than 512mb of ram instead of caching it to the hard drive. If they do this there's no need for the ramdisk.
|
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
|
If this works, it's a bug in Second Life.
11-22-2005 11:44
If any application that uses a cache works better if the cache is in a RAM disk than if the cache is on disk and the RAM taken up by the cache is just used for the program itself, then there's just plain something wrong with that application.
|
Steve Steed
Premium account
Join date: 2 Sep 2004
Posts: 420
|
Use IRam
11-22-2005 12:02
Just buy a IRam. From: someone Giga-byte's IRam is a PC add-in card with four DDR DRAM (double data rate dynamic RAM memory) slots that's designed to be used as a PC drive. Because the IRam uses DRAM rather than a hard disk to store information, data can be retrieved from the drive up to 60 times faster than is possible with a hard drive, according to Giga-byte, which showed the board at the Computex exhibition in Taipei this week.
The IRam was originally designed for video and editing applications where users require fast access to very large files, but the company soon realized that the IRam had other potential applications, says Tim Handley, a marketing account manager at the company.
From: someone The IRam holds up to 4GB of DRAM in four memory slots. The card fits into a standard PCI slot, which provides power, and it uses a SATA (Serial ATA) connection for data transfer.
Unlike DRAM-based main memory, the IRam card doesn't lose data when the PC is switched off, says Thomas Chang, a product manager at Giga-byte. As long as the PC is plugged into a socket, a very small amount of current continues to run through some parts of the system, including the PCI slots. This provides enough power to make sure that no data is lost.
If the PC is unplugged, the IRam has an on-board battery for emergency power that can last up to 12 hours.
From: someone The IRam can also be used by gamers, who want to reduce the time required to access stored data. 
_____________________
Second Life is based on the values of tolerance and free expression. Residents are asked to adhere to community standards that are based on the golden rule, but beyond those standards, there are few to no restrictions.
|
Ushuaia Tokugawa
Nobody of Consequence
Join date: 22 Mar 2005
Posts: 268
|
11-22-2005 12:16
From: Lora Morgan Seems like a good idea for me, considering I rarely reboot my computer. Anyone have any ideas on getting this to work on OSX? There are several RAM disk programs out there, but what about setting SL to use it as your cache? I'm not sure how much this actually helps SL run on MacOS X, but if it does there is no additional software required! Everything you need to make a ram disk is built right in. Warning: Ushu is not responsible if you hose your pretty little Mac Step 1: Determine the size of your ram disk (in sectors, sector size being 512) number of sectors = (MB RAM desired) * 2048 50 MB = 102400 200 MB = 409600 500 MB = 1024000 1000 MB = 2048000 Step 2: Open Terminal.app and switch to superuser (you must be logged in as an administrator to do this) computer:~ user$ sudo su - Password: computer:~ root#
Note that the password you enter here is your administrator account password, not the root password if you have the root account enabled Step 3: Create the ram disk computer:~ root# hdid -nomount ram://102400 /dev/disk1
Here I'm creating a ram disk with 102400 sectors (enough for 50 MB). Change this to correspond with the Disk Cache Size Second Life is set to use. Take note of the name of the device that is created ( disk1 in this example) Step 4: Create a filesystem on the device computer:~ root# newfs_hfs /dev/rdisk1 Initialized /dev/rdisk1 as a 50 MB HFS Plus volume
Here I specified rdisk1 which corresponds with disk1 - the device which was created above in step 3 Step 5: Mount the volume computer:~ root# mount -t hfs /dev/disk1 '/Users/user/Library/Application Support/SecondLife/cache'
Here I mount disk1 at the location of the Second Life cache directory. The username I play Second Life under is user in this example, you will need to change it to the MacOS username you play Second Life logged in as. ---- That's it, your Second Life cache directory is now stored on a ram disk, whatever that's worth  Probably the easiest way to revert everything back to normal is just to reboot.
|
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
|
11-22-2005 12:51
you can mount drives as directories in windows too (though nobody does, since it's basicly just a junction (symbolic link) that uses the hardware address instead of a drive letter).
IRam type devices have been around for a good long time. You can also boost read speeds by using a striped RAID array (this is why RAID was invented; old drives had slow access rates, but when stripped they could distribute the load).
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river. - Cyril Connolly
Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence. - James Nachtwey
|
Krazzora Zaftig
Do you have my marbles?
Join date: 20 Aug 2005
Posts: 649
|
11-22-2005 13:43
Also just a slight reminder that in XP, 2000, 2003 most errors occur due to ram issues. By putting more things into ram you run a higher risk of incuring these issues. Hence why you do not get blue screens of death and the like nearly as often. Personally if you need more speed out of your harddrive for SL I'd look into a scsi, raid, firewire, or that new conenction (name evades me right now). Place cache in there and put no other harddrives on the same connection.
|
Ron Overdrive
Registered User
Join date: 10 Jul 2005
Posts: 1,002
|
11-22-2005 18:12
From: Krazzora Zaftig Also just a slight reminder that in XP, 2000, 2003 most errors occur due to ram issues. By putting more things into ram you run a higher risk of incuring these issues. Hence why you do not get blue screens of death and the like nearly as often. Personally if you need more speed out of your harddrive for SL I'd look into a scsi, raid, firewire, or that new conenction (name evades me right now). Place cache in there and put no other harddrives on the same connection. Not all of us can afford to toss in new hardware for SL. I myself don't have a SATA capable motherboard nor do I have RAID available. This way is a cheap fix nothing more. Honestly I have yet to get WinXP to blue screen on me, probly a combo of luck and good maintance to my system. So far I have yet to have any issues.
|
Krazzora Zaftig
Do you have my marbles?
Join date: 20 Aug 2005
Posts: 649
|
11-22-2005 18:26
From: Ron Overdrive Not all of us can afford to toss in new hardware for SL. I myself don't have a SATA capable motherboard nor do I have RAID available. This way is a cheap fix nothing more. Honestly I have yet to get WinXP to blue screen on me, probly a combo of luck and good maintance to my system. So far I have yet to have any issues. It rarly blue screens but that is because most blue screens in 9x, ME are caused by system resource which is directly related to your RAM.
|
Ron Overdrive
Registered User
Join date: 10 Jul 2005
Posts: 1,002
|
11-23-2005 07:25
From: Krazzora Zaftig It rarly blue screens but that is because most blue screens in 9x, ME are caused by system resource which is directly related to your RAM. Thats because XP & 2000 are NT based. NT has a much better grasp over memory management because it has to be able to remain stable enough to be used as a server platform and/or professional desktop platform. So if anyone is bluescreening XP they're doing something wrong.
|
Partington Gould
Registered User
Join date: 15 Sep 2005
Posts: 94
|
I like this idea, but what about using (i.e) an SD card
11-23-2005 10:52
I just bought 2GB of ram (from the 512MB) I had originally, and SL is much smoother, especially flying.
I like the Ramdrive idea, but it steals available ram from all programs.
Since my PC has slots on the front for various memorycards (such as SD Ram, Sony MemoryStick) etc..., what are the thoughts on setting the SL Cache to a maybe a 1GB SD card?
Access to a memory card must be quicker than a spinning hard-drive (right??). Cards are pretty cheapish. I've not looked into the different cards to see what access times are
Now where to change the default directory.
> OK, bit of an edit before I post. I had a quick look at FutureShop.ca, a 7200RPM HDD says 133MB/sec transfer with a 9.3msec seek time. A 'fast' SD card only says 20MB/sec transfer, so either I'm reading it wrong or the HardDrive is 'much' faster than memory.
|
Ron Overdrive
Registered User
Join date: 10 Jul 2005
Posts: 1,002
|
11-23-2005 11:28
From: Partington Gould I just bought 2GB of ram (from the 512MB) I had originally, and SL is much smoother, especially flying.
I like the Ramdrive idea, but it steals available ram from all programs.
Since my PC has slots on the front for various memorycards (such as SD Ram, Sony MemoryStick) etc..., what are the thoughts on setting the SL Cache to a maybe a 1GB SD card?
Access to a memory card must be quicker than a spinning hard-drive (right??). Cards are pretty cheapish. I've not looked into the different cards to see what access times are
Now where to change the default directory.
> OK, bit of an edit before I post. I had a quick look at FutureShop.ca, a 7200RPM HDD says 133MB/sec transfer with a 9.3msec seek time. A 'fast' SD card only says 20MB/sec transfer, so either I'm reading it wrong or the HardDrive is 'much' faster than memory. A HD is much faster then removable memory sticks. Trust me, you have 2.5 gigs of RAM.. do you honestly think you're gonna be utilizing all of it? Even if you were to make 512mb of that into your SL cache, you're still gonna have 2 gigs free for everything else. Plus no one said you had to have it active all the time, only when you're playing SL. (My software allows me to shut down the drive and turn it back on when needed without rebooting.)
|
Partington Gould
Registered User
Join date: 15 Sep 2005
Posts: 94
|
11-23-2005 11:34
Heh. I think I realized I was speaking out of 'behind' when I checked the speeds. I had figured that Hardware Memory would be much faster than something that spins and needs to be accessed, but there's obviously much more to it than that  I'm going to have a play with this when I get home and maybe utilize some of my 2GB.
_____________________
PG - Permanently Confused and prone to Wandering
|
Eggy Lippmann
Wiktator
Join date: 1 May 2003
Posts: 7,939
|
11-23-2005 13:28
Ron, just checking, and I'm pretty sure that SL automatically does this, but do you know about and have enabled that feature in your Preferences that tells SL you have >=512MB of RAM?
|
Ron Overdrive
Registered User
Join date: 10 Jul 2005
Posts: 1,002
|
11-23-2005 14:43
From: Eggy Lippmann Ron, just checking, and I'm pretty sure that SL automatically does this, but do you know about and have enabled that feature in your Preferences that tells SL you have >=512MB of RAM? Yes Eggy I do have that enabled. I still saw a big improvement using this ramdisk method.
|
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
|
11-23-2005 15:46
From: Ron Overdrive Yes Eggy I do have that enabled. I still saw a big improvement using this ramdisk method. Sounds like LL has work to do on their memory management. If you have 2GB of RAM and you tell it to use 2GB, it should use all that 2GB before it even thinks about putting anything in a disk cache.
|