Copilot is your AI companion
Always by your side, ready to support you whenever and wherever you need it.
Dynamically manage the size of the Windows System File Cache.
Important! Selecting a language below will dynamically change the complete page content to that language.
-
The Microsoft Windows Dynamic Cache Service will manage the working set size of the Windows System File Cache. For 64 bit systems this service helps to address the problem of excessive cached read I/O that could eventually consume all of physical memory. Sample source code and compiled files are included in the compressed file.
-
Supported Operating Systems
Windows Server 2003 R2 x64 editions, Windows Server 2003 x64 editions, Windows Server 2008 Datacenter, Windows Server 2008 Enterprise, Windows Server 2008 R2, Windows Server 2008 R2 Datacenter, Windows Server 2008 R2 Enterprise, Windows Server 2008 R2 Standard, Windows Server 2008 Standard, Windows Vista 64-bit Editions Service Pack 1, Windows Vista Enterprise 64-bit edition, Windows Vista Home Basic 64-bit edition, Windows Vista Home Premium 64-bit edition, Windows Vista Ultimate 64-bit edition
Windows Server 2003, Windows Server 2008, Windows Server 2008 R2, Windows Vista
-
Installation and configuration documentation is included in the compressed file.
Dynamic cache service is used for managing file system cache dynamically, this is required when we have situations where 80% of physical memory is consumed by file system cache and when this happens we might experience performance issues on servers like system hangs, application errors, app crash.. etc.
Memory management in Microsoft Windows operating systems uses a demand-based algorithm. If any process requests and uses a large amount of memory, the size of the working set (the number of memory pages in the physical RAM) of the process increases. If these requests are continuous and unchecked, the working set of the process will grow to consume all the physical RAM. In this situation, the working sets for all the other processes are paged out to the hard disk. This behavior decreases the performance of applications and services because the memory pages are continuously written to the hard disk and read from the hard disk.
This behavior also applies to the working set of the system file cache. If there is a continuous and high volume of cached read requests from any process or from any driver, the working set size of the system file cache will grow to meet this demand. The system file cache consumes the physical RAM. Therefore, sufficient amounts of physical RAM are not available for other processes.
On 64-bit versions of Windows operating systems, the size of the virtual address range is typically larger than the physical RAM. In this situation, the working set for the system file cache can increase to consume most of the physical RAM.
To work around this issue, use the GetSystemFileCacheSize API function and the SetSystemFileCacheSize API function to set the maximum or minimum size value for the working sets of the system file cache. The use of these functions is the only supported method to restrict the consumption of physical memory by the system file cache.
The Microsoft Windows Dynamic Cache Service is a sample service that demonstrates one strategy to use these APIs to minimize the effects of this issue.
The memory management algorithms in Windows Server 2008 R2 operating systems were updated to address many file caching problems that were found in earlier versions of Windows. There are only certain unique situations in which you have to implement this service on computers that are running Windows Server 2008 R2.
Dynamic cache service is only applicable for Windows 2008 and Windows 2008 R2 versions of operating systems, initially Dynamic cache service was released only for Windows 2008 and later this year Microsoft released a latest version of Dynamic cache service which is supported on Windows 2008 R2.
I had a scenario where a Windows 2008 file server cluster node had 32 GB of physical memory and the file system cache was consuming 22 GB of server’s physical memory causing server to have hang issues, deadlock condition to the cluster resources and then there were countless unexpected failover of cluster resources causing downtime to the file share resources.
Usage of RamMap.exe tool revealed most of memory was consumed by MetaFile and that was File system cache, to fix this issue I had configured Dynamic cache service to limit file system cache to 2GB and that reduced overall cache usage by 20GB. After I had configured the Dynamic cache service there were no unexpected failover or downtime to file share resources and high memory utilization by file system cache issue was fixed..(see my previous post on how to use RamMap.exe)
The parameters I used to limit file system cache are mentioned below:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DynCache\Parameters
MaxSystemCacheMBytes: 2048
MinSystemCacheMBytes: 100
Latest version of Dynamic cache can be downloaded from : http://www.microsoft.com/en-us/download/details.aspx?id=9258
How to configure Dynamic Cache service on Windows 2008 or 2008 R2
1) Copy DynCache.exe to %SystemRoot%\System32.
2) From a command prompt, run: sc create DynCache binpath= %SystemRoot%\System32\DynCache.exe start= auto type= own DisplayName= “Dynamic Cache Service”
3) Import the DynCache.reg registry file. This registry file contains default settings that you will probably want to modify.
4) Dynamic cache service will monitor the changes made its parameters in registry and any changes made will not require to reboot the server.
To uninstall this service, execute the following commands:
sc stop DynCache
sc delete DynCache
About asifkhandevadi
Hello, I have been working on windows since 9 years and currently working as windows, VMware and MS clustering SME at IBM. Whenever I get free time I participate in Microsoft forums and write some blogs to enhance my technical and communication skills through knowledge sharing. Please contact me on FB or Linkedin if you need any assistance on troubleshooting, implementation and virtualizaton.
How can Uninstall Microsoft Windows Dynamic Cache Service Completely from Computer
Microsoft Windows Dynamic Cache Service removal has been a tough problem on your PC? Do you need an effective way to uninstall Microsoft Windows Dynamic Cache Service quickly with simple steps? Don’t worry, you will be able to solve the problem via the following removing instructions of the program.
Get Bloatware Uninstaller Now
Microsoft Windows Dynamic Cache Service may be great in providing its specific function for the users, but it also can turn out to be a problem when the program get some running issues or you don’t want to keep it on your computer any more. In this case, removing Microsoft Windows Dynamic Cache Service will be the common and also effective means to resolve the problem, and the real difficulty just come out when people try to uninstall Microsoft Windows Dynamic Cache Service from their PCs.
What usually make people to remove Microsoft Windows Dynamic Cache Service
- Microsoft Windows Dynamic Cache Service is not compatible with other installed applications
- Program gets a corrupted issue unexpectedly
- Microsoft Windows Dynamic Cache Service is not as good as the user expected, and need to be erased from the computer
- Microsoft Windows Dynamic Cache Service should be uninstalled first and reinstalled on the PC
- The application is regarded by the user and some websites as a suspect malware
Most common problems of removing the software
- Microsoft Windows Dynamic Cache Service program is not available on the Windows uninstall panel
- Microsoft Windows Dynamic Cache Service can’t be removed from the Windows and always receive a notification
- Nothing happen when click on the uninstall button on Windows
- Microsoft Windows Dynamic Cache Service or the related process still keep running on the computer after removing it
- Some files and traces of the program still can be found
- Removing process running for a long time and does not come to the end
If must be a headache if encountering such a problem on the computer, and there are still many other problems people might come across when perform the program removal on their own computers. Therefore, you should know the right way about how to uninstall Microsoft Windows Dynamic Cache Service from PC, or the way to fix/avoid the removing issue on the computer. Here are just several options that can support you to remove the application well.
How can uninstall Microsoft Windows Dynamic Cache Service well on PC? Check these guides
Option 1: Use the product’s uninstall tool
There are many applications in nowadays provides an uninstall process on the program’s installation folder, or the publisher gets an uninstaller which is specifically used to remove its own products. To remove Microsoft Windows Dynamic Cache Service in this way, please refer to the following uninstall instructions:
- 1. Right-click on Microsoft Windows Dynamic Cache Service icon on the desktop, and select «Open file location»
- 2. Scroll down the list of files and find the uninstall process, usually named «uninst000», «Uninstall», or «Uninstaller»
- 3. Double click on the uninstall process to start the removal
- 4. Follow the uninstall wizard to finish the removal, and restart your computer
- 5. Open the directory of the installation folder again, and make sure everything has been cleared well
- 6. Click on the Windows button on the bottom-left-corner, and enter «regedit» on the search box
-
- 7. Click to open «regedit» or Registry Editor on the search result
-
- 8. Unfold the registry group inside, and find out those registry keys or entries which contains the program’s name
- 9. Back up these files, and then remove them from your computer system
Note: once problems occur after deleting the registry, please restore the back-up registry to Registry Editor.
When using the publisher’s uninstaller, you should download and install the uninstall application additionally, and choose to uninstall Microsoft Windows Dynamic Cache Service from its interface. Similar to the above removal, you should restart your computer after finish the uninstall process, and clear its remnants again which are still staying on the PC.
Things you need to know about Registry Editor
Registry Editor is a place that stores many important registry keys and entries which closely related to the system operation and program’s performance on the computer, removing a wrong file inside usually cause serious problem for the system, so you should be very careful when you have to manually delete some registries inside.
Get Bloatware Uninstaller Now
Option 2:Remove it with Windows uninstall feature
Windows system provide an uninstall feature in Control Panel that support the user to remove unwanted program on the PC, to access this applet in different operating system, you can follow these instructions:
- 1. Open the uninstall panel on Windows system
- 2. Select Microsoft Windows Dynamic Cache Service on the programs list, click on Remove/Uninstall button
-
- 3. Confirm the program removal, and complete the removing steps with guides
- 4. When finish, reboot the computer
- 5. The same to the removing steps in Option 1, you should clear the leftovers in the installation folder as well as Registry Editor
Option 3:Uninstall Microsoft Windows Dynamic Cache Service with Bloatware Uninstaller
If you want to totally avoid the risky manual removal of registry, and handle Microsoft Windows Dynamic Cache Service uninstall more easily and quickly, taking a professional uninstall tool will be a great help for you, because it can count all of the files (including registry keys and temporary files) and provide a complete and automatic removal, thus, many risky and annoying manual steps could be skipped can you can totally remove Microsoft Windows Dynamic Cache Service on the PC more quickly.
Bloatware Uninstaller is an advanced uninstall utility that can give a good example about how uninstall Microsoft Windows Dynamic Cache Service well:
- 1. Install and launch the uninstaller on PC
- 2. Find and select Microsoft Windows Dynamic Cache Service from the programs list, and click on Scan button
-
- 3. When all of files being detected, click on the uninstall or remove button
-
- 4. Follow the uninstall wizard to remove all of components from the computer
-
- 5. Exit the uninstaller when finish, and reboot the computer system
Get Bloatware Uninstaller Now
This is a very effective way to uninstall Microsoft Windows Dynamic Cache Service and other applications, while the manual removal usually resulted in an unsuccessful removal, and the most important point is it is much easier for the common user to take and get rid of the program they want. So it is currently the best way we found and would like to recommend you to remove unneeded programs with a good app uninstaller.
На одном из файловых серверов под управлением Windows Server 2008 R2 обнаружилась проблема с высокой загрузки оперативной памяти (RAM), выливающаяся в проблемы с производительностью сервера и запущенных на нем служб. Как оказалось, память забивалась системным файловым кэшем с метаданными файловой системы. Проблеме потенциально подвержены все файловые сервера с большим количеством файлов, к которым обращаются пользователя. Наиболее критична проблема для 64 битных версий Windows, на которых размер метафайла в памяти может занять практически всю емкость установленной оперативной памяти. В статье разберемся как проявляется проблема, выявим ее источники и способы решения.
Содержание:
- Высокая загрузка оперативной памяти на файловом сервере Windows
- Что такое метафайл в Windows?
- Быстрая очистка метафайла MFT в памяти
- Служба Dynamic Cache Service для управления файловым кэшем
Проблема проявляется следующим образом: в диспетчере задач (Task Manager) видим, что на сервере оперативная память занята на 95-99%.
Перейдя на вкладку процессов, не удастся найти какой-то утекший процесс с аномально высоким потреблением памяти. Кроме того, если навскидку сложить память, занятую всеми процессами, отображаемыми в диспетчере задач, даже близко не удается приблизиться к 50% физической памяти, установленной на сервере. Так кто же съел всю память?
Реальный расклад по использованию оперативной памяти может дать утилита RAMMap (Марка Руссиновича). Качаем архив с утилитой и запускаем из архива файл RAMMap.exe с правами администратора. На вкладке Use Counts, видим, что больше всего физической памяти использует объектом Metafile (в нашем случае на него приходится 11 из 25 Гб оперативной памяти сервера).
Что такое метафайл в Windows?
Метафайл (Metafile) — это часть системного кэша, который содержит метаданные файловой системы NTFS и используется для увеличения быстродействия файловой системы при доступе к файлам. Метаданные NTFS включают в себя данные таблицы MFT (Master File Table). Для каждого файла/папки, к которому обращались пользователи, в метафайле создается соответствующий блок, размером как минимум 1 Кб (запись об атрибуте каждого файла занимает 1кб, и каждый файл имеет как минимум один атрибут). Таким образом, на файловых серверах с большим количеством файлов, к которым идут постоянные обращения, размер системного кэша NTFS (метафайла) может достигать нескольких гигабайт.
Отключить этот кэш или управлять им с помощью стандартных средств Windows не получится. Как решение, можно увеличить количество памяти на сервере, но реализуемо это далеко не всегда.
Если перезагрузить сервер, память используемая метафайлом освобождается, но со временем размер метафайла в памяти все равно начинает неконтролируемо расти.
К примеру, оценить размер MFT таблицы можно с помощью еще одной утилиты Руссиновича – ntfsinfo. К примеру, в нашем примере для 2 Тб диска размер MFT таблицы составляет 13 Гб.
Быстрая очистка метафайла MFT в памяти
Утилита RAMMap предоставляет возможность быстрой очистки используемой памяти от мусора без необходимости перезагрузки сервера. Для этого нужно в меню выбрать раздел Empty -> Empty System Working Set. После этой операции размер памяти под metafile уменьшился в десятки раз, а процент использования RAM сервером упал с 95% до 26%.
Основной недостаток такого метода – процесс очистки ручной и никак не автоматизируется.
Служба Dynamic Cache Service для управления файловым кэшем
Другим, более кардинальным, решением проблемы высокой загрузки оперативной памяти метафайлом файловой системы является установка службы Dynamic Cache Service (http://www.microsoft.com/en-us/download/details.aspx?id=9258). Данная служба через системные API позволяет управлять параметрами выделяемого кэша.
Важно. Используйте данное решение, только при наличии описанных выше проблем. Установка данного сервиса не будет универсальным решением для других причин исчерпания памяти на серверах.
Установка DynCache довольно простая (подробные инструкции есть в архиве с программой).
- Копируем файл в DynCache.exe в каталог %SystemRoot%\System32
- Создадим службу DynCache командой
sc create DynCache binpath= %SystemRoot%\System32\DynCache.exe start= auto type= own DisplayName= "Dynamic Cache Service"
- Импортируем файл DynCache.reg в реестр (содержит дефолтные значения)
- Изменим значения следующих ключей реестра HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DynCache\Parameters
- MaxSystemCacheMBytes: 4096 (dec) – максимальный размер кэша
- MinSystemCacheMBytes: 100 (dec) – минимальный размер
Примечание. Эти и другие параметры службы DynCache нужно отрегулировать в соответствии с количеством установленной памяти и нагрузкой на сервер, требуемой производительности и т.д. Как правило, не стоит задавать размер кэша больше, чем половина установленной на сервере RAM. После внесения изменения службу DynCache перезапускать не нужно, т.к. изменения отслеживаются динамически.
- Запустим службу командой
sc start DynCache
Примечание. Если понадобится удалить службу, воспользуйтесь инструкцией.
В нашем случае, после установки службы DynCache, использование памяти метафайлом перестало превышать заданного нами значения 4 Гб. Пользователи каких-либо проблем с ухудшением производительности файлового сервера не выявили.
Hey @Laurent ! Great question.
The reason we don’t have much documented is because it’s not a CV service, it’s a Microsoft service.
dyncache is the Microsoft Windows Dynamic Cache Service and this was created by MS to address a Memory Cache issue that could occur in 64-bit systems running earlier Windows versions. Essentially, excessive Read IO on the Cache could cause it to grow and consume the available physical memory. To address this issue Microsoft created and deployed the dyncache process.
According to Microsoft, «The Microsoft Windows Dynamic Cache Service will manage the working set size of the Windows System File Cache. For 64 bit systems this service helps to address the problem of excessive cached read I/O that could eventually consume all of physical memory. Sample source code and compiled files are included in the compressed file.»
In Windows Server 2012 and newer this issue has been addressed on backend by Microsoft. According to their documentation, «The problem used to be mitigated by dyncache tool. In Windows Server 2012, the architecture has been redesigned and this problem should no longer exist.»
As a proactive measure we began including the dyncache installer in our Simpana Installer to prevent this Cache issue from occurring. As Windows 2012 was given new architecture to no longer experience this issue, the dyncache service will not have any affect. I did do some digging and did not locate any information indicating there could be any issues with having the service in place on Windows 2012 and I believe this can be safely ignored.
Here’s some links below to the Documentation from Microsoft.
Microsoft Windows Dynamic Cache Service:
https://www.microsoft.com/en-us/download/details.aspx?id=9258
Cache and Memory Manager Potential Performance Issues:
https://msdn.microsoft.com/en-us/library/windows/hardware/dn567645(v=vs.85).aspx
Let me know if you have any further question!
This is a perfect reason why it’s not documented in the commvault docs then !
Thanks a lot for the details, I appreciate.
So no need to focus on this service while cycling CV services or rebooting.