ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Template Debugging Numbers

March 28, 2012 9:31am

Subscribe [3]
  • #1 / Mar 28, 2012 9:31am

    Scott-Parks

    14 posts

    Just had a question about debugging a template. I’ve looked at the template debugger documentation online and only see where to turn it on or off. Is there a place that explains some of the numbers.  When I run template debugging this is what I see as the opening numbers: (0.007074 / 8.27MB) Tag: [redacted]

    I’m assuming that the 0.007074 is the load time for that particular bit of code, but what is the 8.27MB?  That number rises higher and higher on some templates. Sometimes as high as 60+ MB. I’d hate to think that I’m loading something that I’m unaware of at 60+ megs!

    Anyway, just wondering what the second number represents?

    Thanks

  • #2 / Mar 28, 2012 5:30pm

    Boyink!

    5011 posts

    It’s the amount of memory the template is consuming on the server.

  • #3 / Mar 29, 2012 11:40am

    Scott-Parks

    14 posts

    Thanks very much. Greatly appreciated. I’m sure that number is dependant on the size of the site/database etc.  But is that 8-60 MB a typical number?  Our server is dedicated, has a good quad-core processor and 4GB of RAM. Any idea if those numbers will cause problems? 

    Anyway, thanks for the clarification on the number. Perhaps I might repost my further questions to the tech support forum?

  • #4 / Mar 29, 2012 1:06pm

    the3mus1can

    426 posts

    Thanks very much. Greatly appreciated. I’m sure that number is dependent on the size of the site/database etc.

    It is more dependent on the amount of data you are getting out of the database and the amount of HTML you are generating in your template for a particular page request. There are some others things that contribute too.

    But is that 8-60 MB a typical number?

    It can be.  It just depends on what is in your template.

    Any idea if those numbers will cause problems?

    Probably not, but that mainly depends on the amount of traffic the site is receiving.

  • #5 / Mar 29, 2012 2:08pm

    Scott-Parks

    14 posts

    Thanks. This is helping with some of the questions around optimizing and capacity. This is my first site in EE and I’m trying to make sure there are no surprises. At peak times our site will get around 850,000 unique visitors per month and about 7.5 million page views.  On a peak day we might see 40,000 unique visitors and about 270,000 pageviews.

    I’ve built other apps in Codeigniter and they’re running just fine on our server, but this is the first EE site.

    Thanks for all the input.

  • #6 / Mar 29, 2012 2:49pm

    the3mus1can

    426 posts

    You will probably need to do some load testing to see if the server can hold up.

    This is a neat tool for load testing a site: http://loadimpact.com/ and there is always Apache’s ab command line tool.

  • #7 / Mar 29, 2012 5:18pm

    Scott-Parks

    14 posts

    Yes, I’ve been running Apache’s ab and that’s what has led to some of my initial concern. On the page in question I have 4 {exp:channel:entries} tags, all of them use the disable parameter to disable data that I don’t need and all of them use tag caching with a refresh of 30 minutes.  The data each of those 4 tags is retrieving is very limited.

    I have tried caching the template(page) itself and this is the only tactic that gets good results in Apache ab.  I’ve checked my cache folder on the server too to make sure my permissions are good and the directory is writable.

    Below are the numbers I’m seeing from ab when I run a test of -n100 -c3.  This is with tag caching and not the template caching.

    This performance seems unusual. I’m beginning to think this is the structure of my channels and channel fields that might be causing a bloated database structure.


    Server Software:      Apache
    Server Hostname:      mywebsite.com
    Server Port:        80

    Document Path:      /en
    Document Length:      22197 bytes

    Concurrency Level:    3
    Time taken for tests:  202.449 seconds
    Complete requests:    100
    Failed requests:      0
    Write errors:        0
    Total transferred:    2270600 bytes
    HTML transferred:    2219700 bytes
    Requests per second:  0.49 [#/sec] (mean)
    Time per request:    6073.469 [ms] (mean)
    Time per request:    2024.490 [ms] (mean, across all concurrent requests)
    Transfer rate:      10.95 [Kbytes/sec] received

    Connection Times (ms)
              min mean[+/-sd] median   max
    Connect:      5   59 212.8     7   1023
    Processing:  4405 5975 265.1   5956   7153
    Waiting:    4321 5857 243.0   5863   6575
    Total:    4411 6034 343.9   5972   7163

    Percentage of the requests served within a certain time (ms)
      50%  5972
      66%  6028
      75%  6063
      80%  6133
      90%  6389
      95%  6885
      98%  7155
      99%  7163
    100%  7163 (longest request)

  • #8 / Mar 29, 2012 5:24pm

    the3mus1can

    426 posts

    What sort of modules, plugins and/or custom fieldtypes are being used in the template?

  • #9 / Mar 29, 2012 7:41pm

    Scott-Parks

    14 posts

    Thanks, nice to have a different set of eyes looking at this.

    My add-ons are fairly minimal.

    For modules I shut-down everything I’m not using. The active ones are:
    Channel
    Comments
    Email
    Member
    Playa
    RSS
    SafeCracker

    Extensions that I have enabled are: Better Workflow and Playa (I have tried disabling extensions and testing, doesn’t seem to do anything)

    Custom fieldtypes there’s only two additional that have been added:
    NSM TinyMCE
    Playa

    Plugins, - just the default Magpie RSS and XML encode. Although reading some of the optimization threads/wiki recommend turning off PHP in the template. I’ve done that and moved my PHP to 2 plugins. These issues started before I started writing my own plugin to replace the PHP scripts in the template. They are very minimal functions, one is a switch function to compare some text and the other just creates a dynamic link based on the current page the user is on.  Both seem pass through the template debugger without anything noticeable.

  • #10 / Mar 29, 2012 8:05pm

    the3mus1can

    426 posts

    Are you using a lot of Playa fields in the template?  How many queries are being executed?

  • #11 / Mar 29, 2012 8:22pm

    Scott-Parks

    14 posts

    There are 64 queries on the first hit - 31 queries on the second re-load. I’m assuming this is tag caching?  I also used disable parameter to reduce some of those, but that was minimal savings.  I still think 64/31 is high.

    As far as Playa is concerned, I downloaded it to try to use related fields to cut down on the number of {exp:channel:entries} tags I was using. So far though, I’ve achieved relating all my entries by using the standard EE relationship fieldtype.

  • #12 / Mar 29, 2012 8:27pm

    the3mus1can

    426 posts

    Can any of the relationships fields HTML be pre-generate with Preparse (http://www.solspace.com/software/detail/preparse/)?

  • #13 / Mar 29, 2012 10:47pm

    Scott-Parks

    14 posts

    the3mus1can - thanks for all your help and suggestions.  I think I have tracked down the root of these issues. Also, thanks for the suggestion of Preparse. I hadn’t heard of that, but I might still check that out.

    I had a few snippets that were making queries to the db - I thought I could probably hard code the snippet as a global variable, so I did that. I’m also taking all my other snippets that just have html and using as a global variable instead. The above db queries were uncached too, so, it was a hit every time.

    I also had a couple snippets that were returning large portions of the html that was going into the template. This seemed to be a small hit too.

    My queries are now down to 14 pre-cache, 13 primed cache.  And below is my Apache ab test, same as above on the same page. These numbers seem to be much more acceptable.

    Thanks again!

    Scott

    ——————-

    Server Software:      Apache/2.2.20
    Server Hostname:      website
    Server Port:        80

    Document Path:      /en
    Document Length:      5443 bytes

    Concurrency Level:    3
    Time taken for tests:  4.337 seconds
    Complete requests:    100
    Failed requests:      0
    Write errors:        0
    Total transferred:    602000 bytes
    HTML transferred:    544300 bytes
    Requests per second:  23.06 [#/sec] (mean)
    Time per request:    130.105 [ms] (mean)
    Time per request:    43.368 [ms] (mean, across all concurrent requests)
    Transfer rate:      135.56 [Kbytes/sec] received

    Connection Times (ms)
              min mean[+/-sd] median   max
    Connect:      0   0   0.1     0     1
    Processing:  85 129 26.0   126   209
    Waiting:    85 128 25.6   123   199
    Total:      85 129 26.0   126   209

    Percentage of the requests served within a certain time (ms)
      50%  126
      66%  132
      75%  149
      80%  152
      90%  170
      95%  175
      98%  198
      99%  209
    100%  209 (longest request)

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases