Again problems with cache on Azure Web Sites

Topics: General, Installing Orchard, Troubleshooting, Writing modules, Writing themes
May 3, 2013 at 1:04 AM
Running in Reserved mode with 2 CPU and 3,5 Gb memory on AWS
From time to time, Orchard become slow, I cleaned all files, completed the cache debug instruction in contrib.cache, do a total web deploy, and set log4net to trace debug contrib.cache.

I see in parameters that nothing is inserted in cache, here is my trace
2013-05-02 23:44:42,818 [26] Contrib.Cache.Filters.OutputCacheFilter - Cache item added: tenant=Default;url=/;theme=cloudissime;action=display;id=12; - 800
2013-05-02 23:45:40,955 [18] Contrib.Cache.Filters.OutputCacheFilter - Request on: /
2013-05-02 23:45:40,955 [16] Contrib.Cache.Filters.OutputCacheFilter - Request on: /produits/test-product
2013-05-02 23:45:41,517 [16] Contrib.Cache.Filters.OutputCacheFilter - Cached version not found - tenant=Default;url=/produits/test-product;theme=cloudissime;action=display;id=48;
2013-05-02 23:45:41,533 [18] Contrib.Cache.Filters.OutputCacheFilter - Cached version not found - tenant=Default;url=/;theme=cloudissime;action=display;id=12;
2013-05-02 23:46:55,309 [16] Contrib.Cache.Filters.OutputCacheFilter - Cache item added: tenant=Default;url=/produits/test-product;theme=cloudissime;action=display;id=48; - 800
2013-05-02 23:47:00,840 [18] Contrib.Cache.Filters.OutputCacheFilter - Cache item added: tenant=Default;url=/;theme=cloudissime;action=display;id=12; - 800
2013-05-02 23:47:10,339 [20] Contrib.Cache.Filters.OutputCacheFilter - Request ignored based on OutputCache attribute-NakedCart2-ShoppingCart2
2013-05-02 23:51:03,276 [53] Contrib.Cache.Filters.OutputCacheFilter - Request on: /
2013-05-02 23:51:03,760 [53] Contrib.Cache.Filters.OutputCacheFilter - Cached version not found - tenant=Default;url=/;theme=cloudissime;action=display;id=12;
2013-05-02 23:52:26,958 [53] Contrib.Cache.Filters.OutputCacheFilter - Cache item added: tenant=Default;url=/;theme=cloudissime;action=display;id=12; - 800
2013-05-02 23:52:41,847 [45] Contrib.Cache.Filters.OutputCacheFilter - Request on: /
2013-05-02 23:52:42,144 [20] Contrib.Cache.Filters.OutputCacheFilter - Request on: /nakedcontact
2013-05-02 23:52:42,379 [45] Contrib.Cache.Filters.OutputCacheFilter - Cached version not found - tenant=Default;url=/;theme=cloudissime;action=display;id=12;
2013-05-02 23:52:42,769 [20] Contrib.Cache.Filters.OutputCacheFilter - Cached version not found - tenant=Default;url=/nakedcontact;theme=cloudissime;action=nakedcontact;
2013-05-02 23:52:49,472 [20] Contrib.Cache.Filters.OutputCacheFilter - Cache item added: tenant=Default;url=/nakedcontact;theme=cloudissime;action=nakedcontact; - 800
2013-05-02 23:52:59,393 [45] Contrib.Cache.Filters.OutputCacheFilter - Cache item added: tenant=Default;url=/;theme=cloudissime;action=display;id=12; - 800
2013-05-02 23:53:39,484 [20] Contrib.Cache.Filters.OutputCacheFilter - Request on: /produits/test-product
2013-05-02 23:53:39,875 [20] Contrib.Cache.Filters.OutputCacheFilter - Cached version not found - tenant=Default;url=/produits/test-product;theme=cloudissime;action=display;id=48;
I have tried various cache parameters, from 300 to 3600, same result: nothing.

For the cache has been working on previous deployments of same site.

I think that asp.net caching is not always running on Azure Web Sites, may some parameter is missing on deployment ?
May be the caching is done globally and externally by some dedicated global equipment.

I would appreciate to have a better information on this from MS, but in France, nobody seems to be ready to speak.
May 3, 2013 at 9:25 AM
Edited May 3, 2013 at 10:42 AM
I used full tracing and discovered that the moniroring is still active, hundred lines like this in trace
2013-05-03 07:40:26,856 [71] Orchard.Environment.Extensions.Loaders.DynamicExtensionLoader - Monitoring virtual path "~/Modules/Orchard.ContentPicker/Drivers/ContentMenuItemPartDriver.cs"
2013-05-03 07:40:26,856 [73] Orchard.Environment.Extensions.Loaders.DynamicExtensionLoader - Monitoring virtual path "~/Modules/Orchard.Messaging/Models/MessageSettingsPart.cs"
2013-05-03 07:40:26,872 [68] Orchard.Environment.Extensions.Loaders.DynamicExtensionLoader - Monitoring virtual path "~/Modules/Orchard.Projections/Models/QueryPart.cs"
2013-05-03 07:40:26,872 [70] Orchard.Environment.Extensions.Loaders.DynamicExtensionLoader - Monitoring virtual path "~/Modules/Orchard.Widgets/Drivers/WidgetPartDriver.cs"
But I have checked that Config/HostComponent.config is present and that the property for monitoring is disabled <Property Name="Disabled" Value="true"/>

why Orchard code is still going through the Monitor method ???
public override void Monitor(ExtensionDescriptor descriptor, Action<IVolatileToken> monitor) {
            if (Disabled)
                return;

            // If the assembly exists, monitor it
            string assemblyPath = GetAssemblyPath(descriptor);
            if (assemblyPath != null) {
                Logger.Debug("Monitoring virtual path \"{0}\"", assemblyPath);
                monitor(_virtualPathMonitor.WhenPathChanges(assemblyPath));
                return;
            }

            // If the assembly doesn't exist, we monitor the containing "bin" folder, as the assembly 
            // may exist later if it is recompiled in Visual Studio for example, and we need to 
            // detect that as a change of configuration.
            var assemblyDirectory = _virtualPathProvider.Combine(descriptor.Location, descriptor.Id, "bin");
            if (_virtualPathProvider.DirectoryExists(assemblyDirectory)) {
                Logger.Debug("Monitoring virtual path \"{0}\"", assemblyDirectory);
                monitor(_virtualPathMonitor.WhenPathChanges(assemblyDirectory));
            }
        }
LAST UPDATE: seems the file I was seeing as hostcomponent.conig was not the one use by system, after updating it,the monitoring stops.

SEEMS that the Web deploy (last version with Azure sdk 2) is breaking hostcomponent.config, I will try to check why....

ANYWAY even if monitoring is turned off now, the basic contrib.cache does not work ?
When cache debug is turned on, nothing is displayed in the detail pane, and log shows that nothing is found even when inserted just before.