maharmstone / btrfs

WinBtrfs - an open-source btrfs driver for Windows
GNU Lesser General Public License v3.0
5.8k stars 222 forks source link

Filesystem hangs when navigating through directories #666

Open roemer2201 opened 3 months ago

roemer2201 commented 3 months ago

Dear All,

when navigating through the filesystem, explorer hangs and the taskmanager shows high read-activity on the disk.

My Setup: Win 10 LTSC 21H2 WinBTRFS 1.9 Seagate Exos 2X18 18 TB

This HDD contains two Read-/Write-Heads, each one can access one half of the available space, so I created two partitions on this disk (50/50) and setup BTRFS as Raid0 for data and Raid1 for metadata.

Please check the following video to get a sense of what is happening:

https://github.com/maharmstone/btrfs/assets/5441568/cf380c4f-23cf-4bc7-843d-c675caf9636c

Can somebody explain this behavior and what can be done about it, so that navigating feels smooth?

Thank you in advance!

roemer2201 commented 2 months ago

@weskerty You reacted to this post, are you experiencing the same issue?

roemer2201 commented 1 day ago

I like to share some new insights: It seems like the cause of the lags shown above are due to large files. As you can see in my video, there is a 500GB disk image in the root directory and further down that window, there are 2x 256GB and 2x 128GB images. This totals to roughly 1TB of data in the root of the drive. So I created a new directory called "root_directory" and moved the files from the root into it and voila: Navigating becomes smooth again... kind of ... until you hit another folder down the tree, that causes delays. And opening the new "root_directory" still takes ages, so the problem seems to be moved with the contents (meaning the large files). So having large files in the root will cause lags every time accessing the drive.

It came to be that I have a spare 32GB Intel Optane 3D Xpoint SSD laying around. So I installed a caching software: PrimoCache. I formatted that SSD as a cache device and told PrimoCache to cache my WinBTRFS drive (readonly cache). Navigating through the directories caused PrimoCache to write data and now I can see, how much data gets read, when opening "root_directory" with the large files: It is a shocking ~700MB. The SSD cache delivers that amount pretty quickly (with up to 250MB/s (I would have expected more, but anyway)), so the large directory opens within 3 seconds. This is reproducible: Jumping to another directory and then opening "root_directory" again causes 700MB to be read again before actually showing the files.

Maybe this information gives someone a hint on what to do and how to tackle the problem. My next step is to investigate the drives behavior in my Ubuntu (22.04) installation.