NTFS performance issues on a dual host setup

Discussions related to using VirtualBox on Linux hosts.
Post Reply
pietebr
Posts: 3
Joined: 21. Jul 2020, 11:33

NTFS performance issues on a dual host setup

Post by pietebr »

Hi! I thought I made an almost perfect setup for my needs. I have a notebook with dual boot Windows/Lubuntu on SSD, with a data NTFS partition on HDD.

I created a Windows guest and a few Linux guests on the NTFS partition of the SSD, managed to add them on the Lubuntu side and even managed them to access the same smb share on the HDD via both hosts. The only "problem" is the different name of the host-only adapter between the hosts which obliges me to visit the network setting always when I switch hosts, but that is a minor detail which I might be able to change by compiling VirtualBox on either host. However, this is not the issue.

The issue is that after I started to use the guests more on Lubuntu, I noticed some freezing on each guest. On Windows guest I can see from the task manager that the disk (physically on SSD) shows often 100% disk usage which is uncommon for normal SSD use. So I understood (and googled a bit) that NTFS has some performance issues on Linux. And it is not a memory issue, I have 16GB of RAM and the clients have from 4 to 6 GB, so nothing is reaching their memory limit.

So I ask if anybody has a solution to the performance problem or could recommend a better alternative? My SSD is only 240GB, but I am prepared to make a separate ext4 partition to improve the guest performance on the Lubuntu side because I plan to use it more than Windows which I know may have even worse performance drop accessing the guests from the ext4 partition. But if there were any other solution that would remove my actual performance problem, I would be willing to try it. Thanks!
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: NTFS performance issues on a dual host setup

Post by fth0 »

If you haven't already done so, try and enable Use Host I/O Cache in the SATA controller settings. This will speed up all disk I/O considerably. Beware that there is a somewhat higher risk of data loss (5.7. Host Input/Output Caching), that's why it's disabled by default. And in your case, the risk may be higher. Please report your findings.
pietebr
Posts: 3
Joined: 21. Jul 2020, 11:33

Re: NTFS performance issues on a dual host setup

Post by pietebr »

fth0 wrote:If you haven't already done so, try and enable Use Host I/O Cache in the SATA controller settings. This will speed up all disk I/O considerably. Beware that there is a somewhat higher risk of data loss (5.7. Host Input/Output Caching), that's why it's disabled by default. And in your case, the risk may be higher. Please report your findings.
Thanks, I'll try that. I also noticed that SSD option was not checked. I had originally installed the guest on HDD and cloned it to SSD. But I had installed another guest directly on SSD and that didn't have the option checked, either! One would think that the VirtualBox Manager would detect SSD on its own. I will test two clients, one with I/O Cache enabled and both with SSD enabled.

Anyway, all my data will be on the HDD so possible risk on the client VHD is acceptable.
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: NTFS performance issues on a dual host setup

Post by fth0 »

pietebr wrote:One would think that the VirtualBox Manager would detect SSD on its own.
You have to distinguish between the physical disk/drive and the virtual disk/drive. When the SSD option is configured for a virtual disk/drive, VirtualBox tells the guest OS that the virtual disk/drive is an SSD, and the guest OS will typically refrain from running its defragmenter in this case. It doesn't matter if the physical disk/drive is an HDD or SSD.
pietebr
Posts: 3
Joined: 21. Jul 2020, 11:33

Re: NTFS performance issues on a dual host setup

Post by pietebr »

fth0 wrote:
pietebr wrote:One would think that the VirtualBox Manager would detect SSD on its own.
You have to distinguish between the physical disk/drive and the virtual disk/drive. When the SSD option is configured for a virtual disk/drive, VirtualBox tells the guest OS that the virtual disk/drive is an SSD, and the guest OS will typically refrain from running its defragmenter in this case. It doesn't matter if the physical disk/drive is an HDD or SSD.
So wouldn't it still be beneficial for the life of the SSD to check the option?

Anyway, thanks for the I/O Cache tip, I have noticed a remarkable improvement in performance, although there are still occasional spikes in disk usage (and subsequent freezes), but a lot less now.

When I have more time, I still might create the ext4 partition and compare the performance of two identical guests, but for now I am satisfied enough.
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: NTFS performance issues on a dual host setup

Post by fth0 »

pietebr wrote:So wouldn't it still be beneficial for the life of the SSD to check the option?
Yes, I even used the SSD option in the past when I still had HDDs.
Shmu26
Posts: 99
Joined: 21. Dec 2017, 15:32

Re: NTFS performance issues on a dual host setup

Post by Shmu26 »

Will there necessarily be a perceptible performance hit when the host is linux and the guest is stored on ntfs, due to the NTFS-3G driver?
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: NTFS performance issues on a dual host setup

Post by fth0 »

I don't know. What you're asking is a general Linux question, and the answer is probably unrelated to VirtualBox, so Google is your friend. ;)
Shmu26
Posts: 99
Joined: 21. Dec 2017, 15:32

Re: NTFS performance issues on a dual host setup

Post by Shmu26 »

fth0 wrote:I don't know. What you're asking is a general Linux question, and the answer is probably unrelated to VirtualBox, so Google is your friend. ;)
I have noticed a tremendous difference between VirtualBox and VMware when it comes to a guest machine on a NTFS partition. VMware performs horribly, and VB doesn't. I am talking about the old NTFS driver.
So maybe VB is immune to the linux NTFS driver, and it doesn't matter which one you use? Just wondering. I don't see much on the internet about it. NTFS3 is pretty new.
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: NTFS performance issues on a dual host setup

Post by fth0 »

In the configuration of a VirtualBox VM, you can enable/disable Storage > Controller > Use Host I/O Cache. This will lead to two different disk I/O usage patterns on the host side. You could try and investigate which one is preferable when using a Linux NTFS backend. VMware may have a similar setting ...
Post Reply