Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Morten Christensen 61 posts 215 karma points
    Nov 18, 2015 @ 11:35
    Morten Christensen
    0

    A lot of calls to db

    We have a web app in Azure with Umbraco 7.3.1 (we upgraded from 7.2 to 7.3.1, but still same issues). Its located in north eu datacenter, and the DB is also in north eu. Web app is standard S1 and DB is standard S0 (10 DTUs).

    On our dev server, the site and db is hosted on the same intance, so the connection to db is like 0ms.

    In Azure however, we started to see that the site is a lot slower than the dev site. So we used some profiling tools to see what was going on. It turns out that a normal page requests creates a lot of calls to the db. The page is just a normal razor view which inherits from UmbracoTemplatePage. In Umbraco, the current node of this test has 3 custom Tag properties. We get the tags using @CurrentPage.MyTagProperty.

    Here is a screenshot from the build in tool in VS:

    enter image description here

    FIRST SELECT:

    Event Type  Event   Time    Duration    Thread  Detail Description
    ADO.NET Execute Reader "SELECT *
    FROM [cmsMacro]
    LEFT JOIN [cmsMacroProperty]
    ON [cmsMacro].[id] = [cmsMacroProperty].[macro]
    WHERE ([cmsMacro].[macroAlias] = @0)"   16.69s      [6652]
    

    FIRST UPDATE:

    Event Type  Event   Time    Duration    Thread  Detail Description
    ADO.NET Execute NonQuery "UPDATE [cmsContentVersion] SET [ContentId] = @0, [VersionId] = @1, [VersionDate] = @2 WHERE [id] = @3"    20.89s      [6652]
    

    FIRST DELETE:

    Event Type  Event   Time    Duration    Thread  Detail Description
    ADO.NET Execute NonQuery "DELETE FROM cmsTagRelationship WHERE nodeId=3575 AND propertyTypeId=2153" 23.76s      [6652]
    

    Does anyone know why there are SO many calls to the db? Shouldn't it all be cached? Its the same thing in release mode as in debug mode.

    Hope someone can lead us in the right direction :)

  • Morten Christensen 61 posts 215 karma points
    Nov 23, 2015 @ 10:57
    Morten Christensen
    100

    It turns out that @Membership.GetUser() from .net's membership provider was the problem!

    We changed it to MembershipHelper in all razor files, and all db calls are now gone..

  • mscommunities 40 posts 95 karma points
    Dec 03, 2015 @ 09:48
    mscommunities
    0

    I'm curious what tools did you use to see the sql traffic from sql azure? I miss having sql profiler and need a similar way of tracking whats going on there.

  • Morten Christensen 61 posts 215 karma points
    Dec 03, 2015 @ 09:57
    Morten Christensen
    0

    I just used the normal Diagnostic Tool in VS 2015. The screenshot is actually not from a remote debug in Azure, but from my local machine. But is should be the same.. The connectionstring on my local machine was pointing to a Azure sql db.

    The performance of the site increased a lot after I changed the Membership thing.

  • mscommunities 40 posts 95 karma points
    Dec 03, 2015 @ 10:50
    mscommunities
    0

    Oh I see, I am looking for a way to remotely see whats going on in a sql azure db.

Please Sign in or register to post replies

Write your reply to:

Draft