Orchard.Azure.Web is very slow: differences from Orchard.Web?

Topics: Administration, Core
Jun 25, 2013 at 2:11 AM
Edited Jun 25, 2013 at 6:47 PM
I'm using v1.6.1 of Orchard (source version) and the Orchard.Azure.Web project takes ~120 seconds for 1st load and about 15 seconds for subsequent page loads. The non-azure project seems to work much faster so we looked at the differences between the two main VS projects in the source tree i.e.
  1. Orchard.Web (for usual IIS deployments) and
  2. Orchard.Azure.Web (for Azure deployments)
And noticed some differences listed below (hoping to narrow the cause):
  1. Cosmetic but project wide: Orchard.Azure.Web\Properties\AssemblyInfo.cs (it's 2010/ v1.2 !)
  2. Quite different global.asax.cs (not just the Azure Role specific stuff but also the usage of Orchard.WarmupStarter in Orchard.Web but not in Orchard.Azure.Web).
  3. Web.config : Obviously there will be differences here but some I didn't get (I'm ignoring the inconsistencies with space/tabs across them), for example, Orchard.Azure.Web is missing
    1. <add namespace="System.Web.WebPages" />
    2. optimizeCompilations="true"
    3. <assemblyIdentity name="Autofac" publicKeyToken="17863af14b0044da" />
    4. differences in <customErrors mode=, missing WarmupHttpModule httpModule in Orchard.Azure.Web,
    5. commented out <machineKey validationKey="" decryptionKey="" validation="SHA1" decryption="AES" /> (edit: I believe Azure automatically injects it's own machineKey entry during deployment by directly editting web.config - no transformations)
EDIT: Bug report filed at https://orchard.codeplex.com/workitem/19830
Jun 25, 2013 at 6:25 PM
Edited Jun 25, 2013 at 6:43 PM
Anyone have ideas? We tried another experiment where we deployed Orchard from the Azure portal (vs VS2012 source) onto Azure Website (vs Azure Cloud Service). This install was painless and the performance is snappy. This is good news but points to something VERY wrong in the Orchard.Azure.Web VS2012 project that's in the final release repository, the most I see the more it feels like a bug to be reported (I see the issues section, let me try some more before confirming it so)
Jul 12, 2013 at 10:44 PM
Sid -
Seeing the same poor perf here (on my dev machine) - have you found any relief?
Jul 13, 2013 at 3:12 AM
We abandoned the azure project of orchard till the next mature release comes from the orchard team. We're really busy internally to fiddle with this and figure out what's wrong. Till then we're on the "website" version of 1.6.1. Anyway, our ultimate target IS the azure project so we're hoping the release is soon (wishful thinking!)

Coordinator
Jul 13, 2013 at 4:30 PM
I have deployed a fresh azure package last week, from 1.x, and it's pretty fast: http://orchardtest.cloudapp.net
Jul 13, 2013 at 4:50 PM
It's because Orchard sees "sebastienros" .. you get "what is thy bidding my master" but for the rest, Orchard just throws out "I find your lack of faith disturbing" and just get choked. Ok but seriously, this might have been fixed on the 1.x tip (yet to
try) but 1.6.1 won't even deploy (or run?) out of the box from my recollection. If indeed so then a huge thanks for fixing it in the tip! We have a production deployment so should we pull 1.x (any commit hash?) or are you posting 1.7 soon? Cheers Sid
Jul 13, 2013 at 6:23 PM
I tried the latest 1.x (31ba58858fe6) but only got the 404 page, did some checking with failed requests, but nothing from orchard seems to run.

Also tried 5780c871d77a from wednesday, but also a 404.

The steps:
download the version
ClickToBuildAzure
Edit the 2 connectionstrings in ServiceConfiguration.cscfg
Deploy a new Cloud Service
Coordinator
Jul 13, 2013 at 7:46 PM
I think I fixed everything on last Thursday, please try again.
Jul 14, 2013 at 1:46 PM
I tried from a brand new Azure VM (Windows Server 2012, VS2013 Preview)

I installed VS 2012 Express with Azure tools, ClickToBuildAzure, edit connectionstrings, but it didn't work (404)
Jul 15, 2013 at 10:57 PM
  1. I'm actually getting a YSOD when using 1.x at Changeset: 7232 (8e552c012983)
Server Error in '/' Application.
Could not load file or assembly 'Microsoft.WindowsAzure.ServiceRuntime, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. 
I suspect you need to set Local Copy=True in VS2012 for the reference assembly inside Orchard.Azure.Web project. That basically does this inside src\Orchard.Azure\Orchard.Azure.Web\Orchard.Azure.Web.csproj
    <Reference Include="Microsoft.WindowsAzure.ServiceRuntime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <Private>True</Private>
    </Reference>
  1. I see that the projects is still using the oldest support Azure SDK (1.7). I'm not sure if you guys have thought about a formal support cycle but the Azure SDK seems to be hinting at [http://msdn.microsoft.com/en-us/library/windowsazure/dn169556.aspx](gradual phase-out). With 2.0 being out for several weeks, it might be a good idea to jump to that. Note that Azure storage access in 1.8/2.0 is much better and (breaking) different from 1.7.
Jul 15, 2013 at 11:50 PM
After fixing the above, we get
Server Error in '/' Application.
Could not load file or assembly 'msshrtmi, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. 
Something isn't right ...
Jul 15, 2013 at 11:58 PM
Edited Jul 15, 2013 at 11:58 PM
Lastly, those errors are on Azure. If testing within the emulator it runs but performance is very slow (40 sec / page).

Sebastien, your demo site IS fast but your performance is not reproducible. I suspect there is a configuration issue somewhere in the project files which is screwing things up. Anyway we can present logs/stuff to assist?
Coordinator
Jul 16, 2013 at 12:03 AM
I will try again, following the official instructions, just to see if I broke something in the meantime.
Jul 18, 2013 at 8:11 PM
I've got the Azure site working (the 404 was caused by an old Settings.txt on the blob storage)

The azure site is fast, in the emulator the first access to a module is very slow (some even like 40 seconds) but when I have hit all the modules in the admin console they all perform quite well.

Sid_S, are you using the Storage emulator for the blobs as well, or is the real connection string to Azure in there?
Aug 14, 2013 at 5:48 AM
Edited Aug 14, 2013 at 5:49 AM
Ok, so I tried the 1.7 releases.

The pre-built Orchard.Azure releases work very nicely - fast and without issues. It's actually WAY faster than the Azure Websites deployments (dedicated or shared etc). However, we have custom skins, modules etc - so this is purely a checkpoint.

Next, I tried building the project from the sources (from GIT changeset 5e0c26f73cf5, Aug 05, by Sebastien). Using the "ClickToBuildAzurePackage.cmd" script I get the same errors I reported on July 15th (see above, this thread itself for Microsoft.WindowsAzure.ServiceRuntime and msshrtmi related YSOD). Note that even building and publishing from the VS2012 solution (Orchard.Azure solution) results in the same error (of Microsoft.WindowsAzure.ServiceRuntime and msshrtmi).

Sebastien, can you check why the azure project built from sources doesn't work on Azure itself? We're on Win8, x64, VS2012.3. Azure SDK tools 1.8 / 2.0. After seeing the speed, we really must make the switch to Azure Cloud Services ....
Aug 14, 2013 at 7:01 AM
Edited Aug 14, 2013 at 8:30 PM
Update: Ignore this specific post because when I use the ClickToBuildAzurePackage.cmd to build, I do see the entries in the XML file. However, the overall behavior (YSOD) still remains. I'm leaving the contents of the post below just for reference, battle against YSOD continues ... There must be others seeing this fresh out of the box, right?

I noticed an interesting difference in the RuntimeSetup.Manifest file (which is inside src\Orchard.Azure\Orchard.Azure.CloudService\csx\Release\roles\Orchard.Azure.Web\) ; accounts for both the errors seen.

The "pre-built" Orchard.Azure
<?xml version="1.0" encoding="utf-8"?>
<RuntimeSetup>
  <Operation type="Gac" path="base\x64\msshrtmi.dll" />
  <Operation type="Gac" path="base\x86\msshrtmi.dll" />
  <Operation type="Gac" path="base\Microsoft.WindowsAzure.ServiceRuntime.dll" />
  <Operation type="Gac" path="storage\cloud\x64\mswacdmi.dll" />
  <Operation type="Path" path="base\x64" />
  <Operation type="Path" path="base\x86" />
  <Operation type="Path" path="diagnostics\x64" />
  <AdditionalRoleIdentities>
    <Identity username="NetworkService" domain="NT AUTHORITY" />
  </AdditionalRoleIdentities>
</RuntimeSetup>
When I build it:
<?xml version="1.0" encoding="utf-8"?>
<RuntimeSetup>
  <Operation type="Path" path="base\x64" />
  <Operation type="Path" path="base\x86" />
  <Operation type="Path" path="diagnostics\x64" />
  <AdditionalRoleIdentities>
    <Identity username="NetworkService" domain="NT AUTHORITY" />
  </AdditionalRoleIdentities>
</RuntimeSetup>