Why file operations freeze after deleting a folder on a large NTFS volume

There is a computer running Windows Server 2012R2 with an NTFS volume of 54.5 TB. The volume is almost full and highly fragmented (defrag.exe says that it has 98% fragmented space). It is used to store the video archive and has a folder structure: d: \ Video \. There are about 4K folders in the Video section, and each folder contains 100-12K files.

When I delete any of these folders, there is a very long interval (minutes or tens of minutes) when each function of the WINAPI file hangs. They do not return any error that they simply do not return. After this period of time, they will finally return without errors.

In Windows Performance Analyzer, I see that there is one processor thread in the system process during a hang. Its stack:

2 [Root]
3   |- ntoskrnl.exe!KiStartSystemThread
4   |    ntoskrnl.exe!PspSystemThreadStartup
5   |    |- ntoskrnl.exe!ExpWorkerThread
6   |    |    |- Ntfs.sys!NtfsCheckpointAllVolumes
7   |    |    |    Ntfs.sys!NtfsForEachVcb
8   |    |    |    Ntfs.sys!NtfsCheckpointAllVolumesWorker
9   |    |    |    Ntfs.sys!NtfsCheckpointVolume
10  |    |    |    Ntfs.sys!NtfsFreeRecentlyDeallocated
11  |    |    |    |- Ntfs.sys!NtfsDeviceIoControl
12  |    |    |    |    |- Ntfs.sys!NtfsCallStorageDriver
13  |    |    |    |    |    ntoskrnl.exe!KeExpandKernelStackAndCalloutInternal
14  |    |    |    |    |    ntoskrnl.exe!KiSwitchKernelStackContinue
15  |    |    |    |    |    ntoskrnl.exe!KySwitchKernelStackCallout
16  |    |    |    |    |    Ntfs.sys!NtfsStorageDriverCallout
17  |    |    |    |    |    volsnap.sys!VolSnapDeviceControl
18  |    |    |    |    |    |- volsnap.sys!VspQueryCopyFreeBitmap
19  |    |    |    |    |    |    |- ntoskrnl.exe!RtlFindNextForwardRunClearCapped

Can someone help me understand what is happening? I have full access to the server and can provide any additional information.


NTFSInfo Output:

NTFS Information Dump V1.01
Copyright (C) 1997 Mark Russinovich
http://www.sysinternals.com

Volume Size
-----------
Volume size            : 57223549 MB
Total sectors          : 117193830399
Total clusters         : 3662307199
Free clusters          : 7644452
Free space             : 119444 MB (0% of drive)

Allocation Size
----------------
Bytes per sector       : 512
Bytes per cluster      : 16384
Bytes per MFT record   : 1024
Clusters per MFT record: 0

MFT Information
---------------
MFT size               : 14959 MB (0% of drive)
MFT start cluster      : 196608
MFT zone clusters      : 3653996704 - 3654008160
MFT zone size          : 179 MB (0% of drive)
MFT mirror start       : 1
+4
source share
1 answer

Unfortunately, I could not contact the developers in my support conversation. The problem stops playing on this particular machine after we back up the volume. And the incident with support was closed.

We are reworking the mechanism for writing the archive to reduce file fragmentation and fragmentation of free space, and new users saw a problem with small fragmented volumes.

, . .

0

Source: https://habr.com/ru/post/1652566/


All Articles