Usage of Cloud Storage in Umbraco v16

Usage of Cloud Storage in Umbraco v16

I hope you are doing well folks.

We are developing a portal for a client. And would like to make use of Cloud storage like S3 and Azure Storage, … etc. And we have found an open-source official implementation of Azure and one for S3 at the marketplace.

The problem started when we were examining the source code (both projects). This file system operations in Umbraco architecture design is designed to be ‘Synchronous’ in nature, which is okay (not ideal) in case the CMS is accessing a file in a local storage (OS & Disk-cache makes these operations totally synchronous). But if the file were located on a network drive or some Cloud service (Network IO are needed) then all sorts of problems will happens because these operations will result in a direct ‘Asynchronous’ operations because of essential network IO needed. And in both libraries (Azure Storage & S3), you will find the anti pattern ‘sync-over-async’ is used! You will find a pattern like the following ‘.GetAwaiter().GetResult() or .Result()’. This later will result in degraded performance and Thread Pool starvation.

Any idea on how to approach this problem?

See these Github Issues

Thank you.

As @JasonElkin suggests in issue #78, it is possible to configure ImageSharp to use the async AzureBlobStorageImageProvider which will improve performance of the requests made via ImageSharp (any time an image is cropped).

This seems to be the only workaround until IFileSystemProvider is removed from Umbraco’s source which could be a while away yet! Following and commenting your thoughts on issue #78 is the best way to help that happen.

@glombek Is there anyone has successfully deployed a setup with multiple front servers with S3 image backend successfully? (Without problems on the modern .NET version).

@JasonElkin Do you know anything about kind of multiple front servers with S3 storage setup?

Sorry, not with S3. I’ve only used Azure Blob Storage.

Thread Pool starvation is only an issue at scale, the workarounds listed in the linked issue should be enough to mitigate it everywhere except the backoffice itself.

Generally, you don’t want Umbraco to be proxying/streaming the files at scale anyway so serving directly from blob storage and/or caching at the edge with something like Cloudflare will mitigate the problem anyway,