Dnn.Platform
Dnn.Platform copied to clipboard
[Bug]: AzureStorageProvider Performance is Slow on Large Associated Storage Accounts
Is there an existing issue for this?
- [X] I have searched the existing issues
What happened?
When uploading, deleting, moving, or performing other actions using an AzureFolderProvider mapped file the performance of the operation degrades as the particular mapping grows and adds more files.,
Steps to reproduce?
- Configure a Folder Mapping with an AzureFolder (Idealy a clean setup)
- Upload a file, notice fast performance
- Update the folder in Azure/DNN to have many files > 1000 or so and it seems to be visible
- Upload a file againIdeally
Current Behavior
When completing an upload or other operation, you will find that the upload zooms to completed on the UI, but then it takes many seconds, up to 30-40 at times to refresh the listing and truly complete the operation.being completed on the UI, but then it takes many seconds, up to 30-40 at times,
Expected Behavior
This should be a quick operation and should not slow down with the addition of new files/folders.
Relevant log output
No response
Anything else?
In looking at this it seems to be directly related to the behaviors utilized with regards to cache management within the AzureFolderProvider itself.
After each operation you can see that it purges the cache - https://github.com/dnnsoftware/Dnn.Platform/blob/87bed095aa39f7f7843bcf3c9960d2ba206e7182/DNN%20Platform/Providers/FolderProviders/AzureFolderProvider/AzureFolderProvider.cs#L331
The action to re-fill the cache is here - https://github.com/dnnsoftware/Dnn.Platform/blob/87bed095aa39f7f7843bcf3c9960d2ba206e7182/DNN%20Platform/Providers/FolderProviders/AzureFolderProvider/AzureFolderProvider.cs#L241
The issue is that since the mapping is per provider mapping, not per folder or otherwise, this requires a full enumeration of the Azure Blob storage account.
This has two net impacts to operators using Azure Storage Providers
- The performance issues as noted
- Additional billing in Azure as there is pricing for the number of reads etc. (Granted lower costs, but still a cost)
I think we need to look at better strategies for caching, or updating the cache for this provider.
Affected Versions
9.13.2 (latest release), 9.13.3 (alpha), 10.0.0 (alpha)
What browsers are you seeing the problem on?
Firefox, Chrome, Safari, Microsoft Edge
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
@mitchelsellers in addition to this, something calls SynchronizeFiles with a list that can contain a lot of folders (not files) and it throws a potentially huge amount of InvalidFileExtensionException in FolderManager.SynchronizeFiles
It gets entered though this call stack:
I setup a local environment here to troubleshoot this and what is taking the most time is getting the file LastModifiedDate for some reason. If you can join next co-coding session, happy to continue on that path...
Yes, I can try to join next week. I was in the air today when the session was going on