Copied to clipboard

Flag this post as spam?

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


  • greengiant83 88 posts 109 karma points
    Feb 23, 2011 @ 00:01
    greengiant83
    1

    Progressive slow down when inserting documents

    I wanted to see how well umbraco would scale when adding lots of nodes and I noticed that the time it takes to add a document gets noticable progressively slower the more you add.

    I just ran a test on the document.makenew() method by creating a 100 new textpages at a time and noting the amount of time it took to run and here are the results:

    Run Times (in seconds)

    • 9.87
    • 9.69
    • 20.49
    • 32.52
    • 37.95
    • 55.35
    • 69.45
    • 87.19
    • 117.62
    • 129.23
    And it keeps going up from there. If I go and delete all the items and empty the trash, runs times go back down to 9 seconds or so. I tried rebooting the server before emptying the trash, but that didnt seem to effect the times. It goes from less than a tenth of a second to insert a record to over 2 seconds, and the rate of increase seems to rise the more nodes I add.
    Here is the code I used to test:
                DocumentType docType = DocumentType.GetByAlias("umbTextpage");
                User admin = User.GetUser(0);
                DateTime startTime = DateTime.Now;
                Response.Clear();
                for (int i = 0; i < 100; i++)
                {
                    Document doc = Document.MakeNew("Test", docType, admin, 5187);
                    doc.getProperty("bodyText").Value = "Lorem Ipsum";
                    doc.Publish(admin);
                    Response.Write(DateTime.Now.ToLongTimeString() + "<br />\n");
                }
                Response.Write("<br/>\n<br/>\n<br/>\n<br/>\n");
                Response.Write((DateTime.Now - startTime).TotalSeconds);
                Response.End();
    Is there something wrong with my code?  It seems like umbraco should be able to handle a measly 1000~ records without this kind of slow down.
  • James Hildeman 92 posts 88 karma points
    May 02, 2014 @ 22:24
    James Hildeman
    0

    I am running into the same issue but with 7000 records...frankly i can't get past about 2000 without a page timeout (which i can fix).  Is there a faster way to do this same thing via Node or other slimmed down object.  Is there a way to "bulk" import? 

    Can I create just one using MakeNew() and then use .Copy on it from there? 

  • Charles Afford 1163 posts 1709 karma points
    May 05, 2014 @ 17:57
    Charles Afford
    0

    I have the same problem.  I have not hd a look at the source but u guess its something the the sql that is used to save the content.  May be raise it in http://issues.umbraco.org/dashboard

    Charlie :)

  • Charles Afford 1163 posts 1709 karma points
    May 05, 2014 @ 18:04
    Charles Afford
    0

    Could this be a concurrency issue?,  If you have a thread queing up and queing up and queing up faster that the object that is locked can be worked on you are going to see these sort of figures?

    Charlie :)

Please Sign in or register to post replies

Write your reply to:

Draft