Recently we have had a few cases where the root cause has come back to the Temp folder and some of the files placed in it. While CRM itself does not create .tmp files for any of its processes, it is possible that there are parts of some SDK code that are doing so. The files will be created with just a random name with a .tmp extension. Their use isn’t the issue, however, there is a limit on the number of files that can be created with that manner, namely 65535. More information on what kinds of plug-ins or ISV solutions that could cause this issue can be found here.
Where we see the performance impact with CRM in relation to these temporary files can come in one of two locations. Either the SDK solution is running out of the number of available file names or we can run into issues with certain anti-virus programs doing scans on file create and we will get a cascading degradation of performance.
Best practice with the temporary directory is to have it cleared on the server on a regular basis as part of a normal maintenance routine. There are a number of tools and utilities out there that can do automated cleanup of this.
Below are some additional resources that relate to this issue:
Anti-virus exclusions for Microsoft Dynamics CRM
A 0-byte file may be returned when compression is enabled
*This post is locked for comments