biztalktemporary-fileswinscp-netbiztalk-2020

BizTalk Server 2020 - Temp Files not getting cleaned within InProcess User Context


We are using BizTalk Server 2020 with SFTP Adapter (WinSCP Version 5.21.5). Multiple Receive Locations and other Artefacts are running under this user.

Unfortunately our Admin contacted me that the Temp file directory of this user is increasing quickly (Location: C:\Users\<InProcess-User>\AppData\Local\Temp) – currently we are talking about a storage capacity of 30 GB. It seems like most of the files are related to the SFTP Adapter and used for tracking sessions during the WinSCP connections.

The InProcess user has Full control permissions to this folder.

I have following questions to this behavior

  1. Why are the files not getting cleaned up?
  2. Is there are setting which can be set up for this cleanup? If yes, where can I find it?
  3. How can I avoid BizTalk following this behavior?
  4. If there is no default functionality for it, what would be the best way to cleanup these files? Having a scheduled task, which cleans up files, older than x days?

My assumption is that directly after closing the connection, the SFTP adapter functionality should be responsible deleting that file, is that correct? Additionally I installed the CU5, hoping that it was a problem with the WinSCP version.


Solution

  • From my blog post Max worker threads for SFTP, MQSC or DB in BizTalk there are some recommendations to avoid issues with the SFTP adapter (amended with the fix for the above issue).

    Recommendations for SFTP Receive Locations

    1. Have a dedicated host for receive locations using SFTP
    2. Increase the Maximum Worker threads setting to 500 on that host instance
    3. Check how frequently you poll (the default is 5 seconds), increase the delay if that is not needed.
    4. Put a schedule on to only poll during the periods you need.
    5. Disable message body tracking if it is not needed.
    6. For BizTalk 2016 ensure that FIX: Shared temporary files may never be deleted if BizTalk, WinSCP and SFTP server remain active installed (Cumulative Update 7 or up) or try reducing the Maximum Connection Reuse Time if there is an issue with temporary files.