Copied to clipboard

Flag this post as spam?

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


  • Michael Giagnocavo 2 posts 22 karma points
    Mar 13, 2015 @ 06:14
    Michael Giagnocavo
    0

    How to force Umbraco to use XML cache on first start

    Hi there!


    I'm using Umbraco 7.2.2 and having a rather difficult time with first-load performance. Using MiniProfiler, I can see that my homepage is making about 160 SQL queries on first load. (On subsequent loads, it's fine at 0.) It seems to be anytime I use the Umbraco helper functions like Media or Content or whatnot that all these queries are kicked off.

    We only have around 150 actual content nodes (plus a few member nodes for testing). The umbraco.config cache file is only 100KB.

    I've deleted umbraco.config and it gets regenerated just fine. But no matter what settings I try in umbracoSettings.config (XmlCacheEnabled and similar ones), every time I restart the app, first load makes a hundred SQL queries.

    Is this normal? Is there a flag I can set to tell it to use umbraco.config instead of hitting the DB? I've turned off debugging (ASP.NET compilation as well as umbracoDebugMode="false").

    I see "Loading content from disk cache..." in the UmbracoTraceLog.txt, and no exceptions or anything special.

    What else can I do to make the app warm up fast, besides putting SQL Server on the same machine?

    Edit: I've tried it out on a separate site that's running Umbraco 6.2. Same behaviour. First load takes quite a while, and 265 SQL queries are made (this site has a few more nodes). After first load and the app is warmed up, things are OK. But that warm-up time can be really damaging with a non-local SQL Server.

  • Dave Woestenborghs 3504 posts 12134 karma points MVP 9x admin c-trib
    Mar 13, 2015 @ 10:41
    Dave Woestenborghs
    1

    I think umbraco actually uses the xml cache from disk on startup. Why ?

    In our company we work with several developers and all have a local instance of Umbraco with a shared database. I often need to republish content after startup to see the latest version of the content added by other developers. I think the queryies are related to finding template associated with your content item and fetching media items. These are only stored in memory after first retreival.

    Dave

  • Dave Woestenborghs 3504 posts 12134 karma points MVP 9x admin c-trib
    Mar 13, 2015 @ 10:44
    Dave Woestenborghs
    0

    Also if it is media items that are slowing down your website maybe using examine can help you out. See some examples in the articles.

    http://shazwazza.com/post/ultra-fast-media-performance-in-umbraco/

    http://sleslie.me/2015/selecting-media-using-razor-slow-performance-examine-to-the-rescue/

  • Michael Giagnocavo 2 posts 22 karma points
    Mar 13, 2015 @ 23:48
    Michael Giagnocavo
    0

    Hmm well we certainly don't make 150 media requests. Another site, running 6.2, makes over 250 SQL queries on start. And we're certainly not calling GetMedia or whatnot that many times. :\

Please Sign in or register to post replies

Write your reply to:

Draft