Tuesday, July 10, 2018

RAMdisk

I think we are all in agreement that better performance in Second Life is a good thing, right? We're all looking for a smoother, faster refresh on the display, less lag, fewer crashes, and all of that. (Now, where is that drama slider?)

Right now, I'm on an Asus laptop with an overclocked nVidia 1080 in it that blows so much heat, the cats sleep along the fan exhaust. And yet, I want faster. (But I don't want a laptop with dual 1080's or a Titan and 64GB of RAM yet because I'm having enough trouble already lifting this behemoth. And, yes, I prefer laptops despite the cost and performance loss from mobile-friendly components.)

One of the things I've recently tinkered with is using a RAMdisk for temporary and swap files. A RAMdisk is a virtual disk drive that you create in your system's memory. System memory is a lot faster than conventional disk drives. And it's faster than these solid-state drives (SSD) that are in newer systems. Solid-state drives also have an issue with wearing out over time, while system memory doesn't have that issue as much.

I've been playing a bit with SoftPerfect's RAM Disk for Windows (https://www.softperfect.com/products/ramdisk/) for $29US, but there's a free 30-day demo of the software if you want to try it out for yourself. There's also other programs out there on the market.

I went ahead and dedicated 4GB (4096MB) of my laptop's 16GB for a RAM Disk, configured it as my S drive, and configured FireStorm to use it for its cache. (It's also possible to install FireStorm in the RAMdisk as well as reroute Windows temproary files into it, but I'm just starting with FireStorm's cache for now.) I created a drive image file and set the RAMdisk to save its contents to that image so that it would preserve the cache between sessions. (That's drive image, not Club IMAGE) Otherwise, it would have to load all that content fresh between sessions.

Anyway, here's the steps I followed (If I missed a step, let me know, and I'll update the post):

  1. Download and install the software.
  2. In the menu bar, select Image and then Create Image.
  3. Name the image something (SLDisk) and select a directory on a fast drive (solid state preferred).
  4. Set the size (I chose 4096MB) and the preferred file system (I chose NTFS, but FAT32 also will work).
  5. Click OK.
  6. In the menu bar, select Disk and then Add.
  7. Set the size (I chose 4096MB) and select the image that you created in step 3.
  8. Select a drive letter (I chose S).
  9. Select Save Contents to Image.
  10. Select the same File System as the Image (I chose NTFS).
  11. Click OK.
  12. In FireStorm, open Preferences (Control-P)
  13. Click the Network and Files tab.
  14. Click the Directories tab.
  15. Click Set and then select the S drive for both Cache location and Sound Cache location.
  16. Slide the Cache size to slightly less than the size of the RAMdisk.
  17. Restart FireStorm.

I haven't gotten out the stopwatch to measure the performance gain, but I do notice that things load from cache a bit quicker. However, in large crowds of complex avatars, things still do bog down a bit, and there is the occasional texture-thrash... and golly, where do we see large crowds with complex avatars, right?

There is a few seconds of lag time in booting up and shutting down when the system saves and loads the RAMdrive to the disk image and back again, but with a solid-state drive hosting the image, it hasn't been too long, I think.

Also, it's been running smoothly, and no crashes... but this is SL, and I'm curious to see how it does handle a viewer crash. And this being Windows, I wonder how it will handle a total system hang or crash and if there's file corruption that requires a reset or rebuild of the RAMdisk.

Anyway, thought I'd share this, in case it's of interest and an option for anyone.

Thank you to Usher Piers for his advice and guidance on this.

  • What do y'all do to your systems and viewers to improve performance?
  • What is your experience with Ramdisks and caches?