question

FrodeSolvang-5559 avatar image
0 Votes"
FrodeSolvang-5559 asked SnehaAgrawal-MSFT answered

Appservice swap operation is failing due to local cache?

Swap between staging and production slots is failing both from ps and Azure Portal.
The diagnostics says:
Local cache refresh for site failed as size for local cache 2001Mb is > 95% of quota 2000Mb

According to documentation the local cache contains a one-time copy of the /site and /siteextensions folders but as far as I can see my site + siteextension is approxx 200MB.

Why is the swap failing with this amount of content?

Any tips or help to solve this is appreciated!

-Frode

azure-webapps
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

SnehaAgrawal-MSFT avatar image
0 Votes"
SnehaAgrawal-MSFT answered FrodeSolvang-5559 commented

Thanks for asking question! As defined here that the local cache contains a one-time copy of the /site and /siteextensions folders of the shared content store, at D:\home\site and D:\home\siteextensions, respectively.

The files are copied to the local cache when the app starts. The size of the two folders for each app is limited to 1 GB by default note that this includes the /site and /siteextensions folders that are copied from the content store, as well as any locally created logs and data folders.

To increase this limit, use the app setting WEBSITE_LOCAL_CACHE_SIZEINMB.

You can increase the size up to 2 GB (2000 MB) per app.

Further you may want to know that the App Service silently ignores local cache and reads from the remote file share. If there is no limit defined or the limit is set to anything lower than 2 GB and if the copied files exceeds the limit, the deployment or swap may fail with an error.

Also the best practices for using App Service Local Cache is to use local cache in conjunction with the Staging Environment feature.

Add the sticky app setting WEBSITE_LOCAL_CACHE_OPTION with the value Always to your Production slot. If you're using WEBSITE_LOCAL_CACHE_SIZEINMB, also add it as a sticky setting to your Production slot.

Let us know if there is further query or issue remains.




· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks for helping out!

Cachelimit is set to 2GB and the WEBSITE_LOCAL_CACHE_OPTION is enabled only on the production slot.

According to attached image we are way below the 2GB limit

94036-image.png


94044-image.png


0 Votes 0 ·
image.png (10.5 KiB)
image.png (10.8 KiB)
SnehaAgrawal-MSFT avatar image
0 Votes"
SnehaAgrawal-MSFT answered

Update: The issue has been resolved after creating webjob to clean the logs and disabling local cache.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.