So I've been having really slow performance site when it comes to image loading, resizing and the lot using the ImageProcessor within Umbraco.
Currently using:
CloudFront doesn't cache the images either (custom origin doesn't get cached from what I understand?), so to avoid the site falling over, I have an NGINX server between CloudFront and the Umbraco servers (which are behind a standard AWS load balancer).
It's hard to think that 2 x c4.xlarge instances can't cope with processing the images instantly.
One thing I noticed that happens sometimes is the following: Log snippet
I just put new pair of AWS access keys to see if it will make any difference, but sadly, still slow. Even the backoffice takes ages to load up previews of the images in both the content tab and media tab.
Configuration wise, I've triple checked against what I've found on the internet (for FileSystemProviders and ImageProcessor configs).
Imageprocessor cache config:
<?xml version="1.0" encoding="utf-8" ?>
<!-- For more information on using transformations
see the web.config examples at http://go.microsoft.com/fwlink/?LinkId=214134. -->
<caching xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform" currentCache="AmazonS3Cache" xdt:Transform="Replace">
<caches>
<cache name="AmazonS3Cache" type="formula_e.web.cms.Core.ImageProcessor.AmazonS3Cache, formula-e.web.cms" maxDays="365" xdt:Locator="Match(name)" xdt:Transform="Replace">
<settings>
<setting key="AwsAccessKey" value="XXXXXXX" />
<setting key="AwsSecretKey" value="XXXXXXX" />
<setting key="AwsBucketName" value="XXXXXXX" />
<setting key="AwsEndpoint" value="http://XXXXXXX.s3.amazonaws.com/" />
<setting key="AwsBucketFolder" value="cache-live" />
<setting key="CachedCDNRoot" value="http://XXXXXXX.cloudfront.net" />
<setting key="StreamCachedImage" value="true" />
</settings>
</cache>
</caches>
</caching>
Imageprocessor security config:
<?xml version="1.0" encoding="utf-8" ?>
<!-- For more information on using transformations
see the web.config examples at http://go.microsoft.com/fwlink/?LinkId=214134. -->
<security xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<services xdt:Transform="Replace">
<service prefix="media/" name="CloudImageService" type="ImageProcessor.Web.Services.CloudImageService, ImageProcessor.Web">
<settings>
<setting key="MaxBytes" value="41943040"/>
<setting key="Timeout" value="30000"/>
<setting key="Host" value="http://XXXXXXX.s3.amazonaws.com/media/"/>
</settings>
</service>
</services>
</security>
Filesytemproviders config:
<?xml version="1.0" encoding="utf-8" ?>
<!-- For more information on using transformations
see the web.config examples at http://go.microsoft.com/fwlink/?LinkId=214134. -->
<FileSystemProviders xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<Provider alias="media" type="Umbraco.Storage.S3.BucketFileSystem, Umbraco.Storage.S3" xdt:Locator="Match(alias)" xdt:Transform="Replace">
<Parameters>
<!-- S3 Bucket Name -->
<add key="bucketName" value="XXXXXXX" />
<!-- S3 Bucket Hostname - Used for storage in umbraco's database (Should be blank when using Virtual File Provider) -->
<add key="bucketHostName" value="" />
<!-- S3 Object Key Prefix - What should we prefix keys with? -->
<add key="bucketKeyPrefix" value="media" />
<!-- AWS Region Endpoint (us-east-1/us-west-1/ap-southeast-2) Important to get right otherwise all API requests will return a 30x response -->
<add key="region" value="eu-west-1" />
</Parameters>
</Provider>
</FileSystemProviders>
How do I go about finding out what the issue is?
For anyone having a similar issue, the whole problem was within the cache config file and caused the whole system to be performing really slowly when several images were requested at the same time, due to the cache of the images being in S3 rather than locally.
The cache was set to currentCache="AmazonS3Cache" which is not even official (confirmed by JamesSouth).
Once I put currentCache="DiskCache" on the production machines, everything was working as it should.