Pages

Sunday, March 5, 2017

RAMdisk performance in a virtual machine

Thought I would share some performance testing I have done, regarding using RAM disks in conjunction with virtual machines.

imageI am using VMware Workstation, to do a lot of software demonstrations, and of course wants the best performance possible, when in front of potential customers. So I am dragging around one of the fastest laptops on the market, Dell XPS 15 9550 spec’ed as you can see in the picture, using it as the Host machine for my demo VM’s. The physical HD is a 1TB SSD.

imageSo with plenty of RAM, I want to se if I can squeeze some more performance out my VM’s, running web applications with databases intensive tasks. My intention is to move both websites and DB to RAMdisks, and wanted to see if I should just create one RAMdisk for both website and DB’s of have two RAMdisk, one for the websites and one for the DB’s.

My VM is Microsoft Windows Server 2012 R2 Standard, and configures as in the picture.

One thing to note about VMware configuration, is that VMware has a general setting, where you can force to keep the VM’s in physical RAM, so that when configured to use 16 GB, it will use 16 GB physical RAM, and not try to swap some of the ram to the hard drive. Not sure how it affects a RAMdisk inside the VM, but to be sure I have enabled this option.

I am using https://www.softperfect.com/products/ramdisk/ . Did a lot of investigation, as there is many RAMdisk vendors out there. Softperfect RAM disk, was chosen because of top performance, ability to create persistent disks and OK price ($29.00 private/$49.00 Business).

So on to the testing. First, some normal disk performance figures running CrystalDiskMark (CDM), both inside the VM and on the host. As you can see, there is a performance penalty inside the virtual machine, when it comes to disk performance.

Standard VM disk For reference, Host physical SSD
image image

Next, performance of RAMdisk.

RAMdisk inside the VM For reference, Host RAMdisk
image image

As expected, significant performance increase, compared to regular disks, both inside VM and on the Host.

Odd thing here is that the 4K tests inside the VM actually out performs the same on the host.

Now lets see if we can get higher performance with two RAMdrive’s inside the VM, tested simultaneously
RAMdrive 1 RAMdrive 2
image image

A small performance gain, but I am sure that it is caused by the two tests, not running 100% in sync. CDM does each test 5 time, and pauses both between each repetition and each of the eight test. As the tests are not pausing at exactly the same time, one of the CDM instances will have 100% of the bandwidth on its own.

One thing to note here is that, even running two instances of CDM, only one CPU kernel is used, and it is maxing out.
IO and CPU performance counters  
image image

Just for reference, testing two RAMdrive’s simultaneously on the host. ON the Host, we have the same issue that both CDM instances uses CPU1 that is maxed out, and the sum Read/Write is about the same as for one RAMdisk.
Two RAM drives on host – IO performance counter
image  image  image

Just to confirm, the problem running two instances of CDM at the same time, I have also tested with one RAM Disks inside the VM (NTFS), but tested simultaneously with two instances of CDM. Results here are mixed. Some are better than when testing two RAM disks, some are worse. Again, sure that this is caused by the two instances not being 100% in sync.

As you can see in the I/O graph, comparing it to the same for testing two RAMdisks, the read sequences, are slightly more off. For the pink write test, especially the second last one, they run more simultaneously, and here we actually gets less MB/s compared to writing to two disks.
     
image image image

Conclusion

Great performance gain of using RAMdisk. No real gain of using two disks, but this can be caused by several reasons. CDM only using one CPU that max out, is one of them. But it could also be that Soft perfect RAM disk driver is handling both disks.

As for my own purpose, I have moved my websites and DB’s to a RAM disk, and see a significant increase in especially load time when hitting my websites for the first time after boot. As the websites/applications utilize heavy caching, once warmed up, there is not much difference. But my websites has some DB heavy publishing process, where huge amount of date is read/written to my databases. One of these process take about 10 minutes, with website and DB’s moved to a RAMdisk, I was able to cut that down to 6 minutes.

One caveat of RAMdisk the way I am using it, using persistent disks, is that it takes longer booting and shutting down the VM. In my case, I have a 6GB persistent disk, and that of course need to be loaded every time I boot the machine, as well as written to disk on shutdown. Also there is a risk associated with RAMdisks, as you loose all data when your machine crash. Softperfect has an option, to write the content of persistent RAM disks to its disk file, at configurable intervals, and you can also do it manually.

This also affects Microsoft SQL Server, as the RAMdisk, on boot, actually does not get loaded fast enough, so the DB you have on RAMdisk, will go into recovery mode. This can be fixed, just restarting the SQL server service. You can also make SQL Server service delay start, or start it manually.


Friday, October 2, 2015

Day 1 - Being Mac'ed–Confessions of a Windows aficionado

Unboxing my first Mac today, and thought I would share my experience, as a lifelong Windows aficionado. Writing about the pros and cons, trying to keep an open mind, I have no doubts, I will run into situations where I wished I never made this move.
My employer, IBM, have blessed we with a MacBook Pro Retina 15. (The latest and greatest I suppose :-)
So day 1 – UnBoxing leads to my first confession. What a beauty! And this is strong words from a Windows aficionado, IBM'er, former HP and Compaq, who have been spoiled with the best HW at all times.
I think most people who now me, would go a far as calling me a "Mac hater", but getting this piece of aluminum in my hands, I have to cave in.
Any cons on day one. Really to minor to mention, but compared to my current ASUS Zenbook, I find the keyboard to both harder and more noisy. Can imagine, and hope it will soften a bit, after some use. Sure many keys are missing and in the wrong places. But I knew that and will just have to learn (But why move the @ key, I am sure its most comfortable being on the same key as 2.
Well managed to get through the first boot and setup, without any problems, except I quickly found out that having my full name as "Full name" was not smart, as it is the login you have to enter a lot of times as your credentials. With the help of google, also shortned my account name, as I can imagine having to entering it a lot in terminals, knowing I want to get into the engine room of my Mac.

END NOTE: Back in 1984 I was an exchange student in Colorado Springs, where I took my first computer class. It was Fortran programming using punch cards. In 3rd semester the school got some Apple Macintosh computers. Of course tried them, but no fun at all, as you could not make them print anything! (In Fortran class we sent the punch cards down town for processing, and got the result back on endless paper. Sometimes several miles, when accidently having programmed an endless loop in the print code).
But no kidding. The video shows the first time I have ever turned on a Mac since 1984!


Technorati Tags: ,,,