We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17723
    • 221 Posts
    Hello,
    I'm trying to find out where can be the problem causing excessive server CPU usage - some times getting up to 1000% of its power.
    I'm running Revo 2.2.7 / PHP Version 5.2.17 / MySql 5.1.59. On reliable shared linux hosting.

    Is there any tool that can point me to which scripts can cause this overload?
    All snippets are updated and mostly cashed apart from one getResources - for listing and filtering upcoming events and there is a BannerY component that is not cashed as well - for displaying banners.
    The rest snippets are commonly used ones and cashed - Wayfinder (4 calls on page), quip, migx (getImages), gallery, ultimatparemt.

    I would be really thankful if someone could point me to where to look for solutions.


    The error log:
     [2013-04-10 19:50:00] (ERROR @ /connectors/system/log.php) Could not load class: byAd from mysql.byad.
    [2013-04-10 19:50:00] (ERROR @ /connectors/system/log.php) byAd::load() is not a valid static method.
    [2013-04-10 19:50:36] (ERROR @ /connectors/system/log.php) Could not load class: byAd from mysql.byad.
    [2013-04-10 19:50:36] (ERROR @ /connectors/system/log.php) byAd::load() is not a valid static method.
    [2013-04-11 10:39:13] (ERROR @ /manager/index.php) Error 23000 executing statement:
    INSERT INTO `modx_session` (`id`, `access`, `data`) VALUES ('p6b739ev4ph10g40t0fuvaa445', 1365669553, 'modx.user.contextTokens|a:0:{}')
    Array
    (
        [0] => 23000
        [1] => 1062
        [2] => Duplicate entry 'p6b739ev4ph10g40t0fuvaa445' for key 'PRIMARY'
    )
    
    
      Lucas from AroundCyprus.net
      • 42967
      • 143 Posts
      how are you handling caching ?
        Eighth day design
        Design agency with offices in Edinburgh and Brighton
        • 17723
        • 221 Posts
        Thanks for replying.
        I haven't modified any cache system settings.
        Just running my snippets cached.
        Here is my sidebar with some snippets:
            <div id="leftCol">
        <div id="mainSubNav">
        [[Wayfinder? &startId=`[[Ultimateparent? &topLevel=`1`]]` &level=`1` &excludeDocs=`10,11,12` ]]
        </div>
        
        [[Wayfinder? &startId=`9` &level=`1` &excludeDocs=`11,12`]]
        <div id="koncerty">
        [[!getResources:default=`<span>Nie mamy jeszcze potwierdzonych<br /> terminów koncertów.</span>`? 
        &parents=`10` 
        &tpl=`tplLeftColKoncerty` 
        &limit=`4` 
        &includeTVs=`1`
        &sortbyTV=`eventstart`
        &sortdirTV=`ASC`
        &tvFilters=`eventstart>=[[!now]]`
        ]]
        </div>
        [[Wayfinder? &startId=`9` &level=`1` &excludeDocs=`10,12`]]
        
        <div id="newsy">
        [[getResources? &parents=`11` &tpl=`LeftColNewsy` &limit=`4`]]
        </div>
        
        [[Wayfinder? &startId=`9` &level=`1` &excludeDocs=`10,11`]]
        
        
        
        
        <div id="ksiega">
        [[!QuipLatestComments? &type=`thread` &thread=`ksiega` &tpl=`ostatniWpis` &limit=`1`]]
        </div>
        <div id="polecamy">
        <span>Dołącz do fanów:</span>
        <div class="clearer"> </div>
        <a href="http://www.youtube.com/user/tgdps/videos" target="_blank"><img src="tpl/images/iconYT.png" width="25" height="25" /></a>
        <a href="http://www.facebook.com/chor.tgd" target="_blank"><img src="tpl/images/iconFB.png" width="25" height="25" /></a>
        </div>
        <div id="bannerBox">
        [[!BannerY? &position=`1` &tpl=`topBanner` &sortby=`RAND()` &limit=`1`]]
        </div>
            </div>
        
          Lucas from AroundCyprus.net
          • 42967
          • 143 Posts
          You have a lot going on - do you need to call BannerY & getResources uncahced ? try adding &depth=`1` to your getResources snippet and then look into extras like getcache and xFPC
            Eighth day design
            Design agency with offices in Edinburgh and Brighton
            • 17723
            • 221 Posts
            Good idea with the &depth. Will do it.
            Unfortunately I can't run BannerY & getResources uncached.

            I could rewrite the website layout to not use 3 cached Wayfinder calls - but I don't think it will change a lot since they are anyhow cached.

            I still thing that there needs to be some other reason to this excessive CPU usage. I've developed a lot of websites with Revo and some have used similar usage of snippets and the CPU was very low.

            If You will still have any other idea, please let me know.


              Lucas from AroundCyprus.net
              • 3749
              • 24,544 Posts
              Sometimes that's caused by a circular reference like a getResources call that included the page the getResources tag is on.
                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting
                • 17723
                • 221 Posts
                Hello Bob,
                I've reviewed my pages and there is no such a situation. But I think that the main page that holds even more calls to getResources might cause it.
                Apart from the left side bar that I've posted at the beginning of this post, there is the main page that has this snippets:
                [[!getResources?  &tpl=`koncertItem` &parent=`10` &includeTVs=`1` &includeContent=`1`
                &limit=`0`
                &sortbyTV=`eventstart`
                &sortdirTV=`ASC`
                &tvFilters=`eventstart>=[[!now]]`
                 ]] 
                <br clear="all" />
                <br />
                <h3>Tu już zagraliśmy:</h3>
                [[!getPage@paginacja?
                   &elementClass=`modSnippet`
                   &element=`getResources`  &tpl=`koncertItem` &parent=`10` &includeTVs=`1` &includeContent=`1`
                &limit=`5`
                &sortbyTV=`eventstart`
                &sortdirTV=`DESC`
                &tvFilters=`eventstart<=[[!now]]`
                 ]] 
                <br clear="all" />
                <div class="paging">
                <ul class="pageList">
                  [[!+page.nav]]
                </ul>


                Please advice me what to do in this situation when I can't call my snippets cached, and need to speed up the preformance???
                  Lucas from AroundCyprus.net
                  • 3749
                  • 24,544 Posts
                  That's a lot of processing. How many Resources are under Resource 10?
                    Did I help you? Buy me a beer
                    Get my Book: MODX:The Official Guide
                    MODX info for everyone: http://bobsguides.com/modx.html
                    My MODX Extras
                    Bob's Guides is now hosted at A2 MODX Hosting
                    • 17723
                    • 221 Posts
                    As for now there are 20, but will be growing - by the end of the year about 50 and next year 100 resources
                      Lucas from AroundCyprus.net
                      • 3749
                      • 24,544 Posts
                      You could try calling the other snippets cached and manually clear the cache yourself periodically to see if that helps. Still, with only 20 resources, I wouldn't expect that kind of load. I don't know what would cause it unless spiders or hackers are hammering your site.

                      Ultimately, you'll probably want to create a custom database for your events and use a custom snippet to display the data.
                        Did I help you? Buy me a beer
                        Get my Book: MODX:The Official Guide
                        MODX info for everyone: http://bobsguides.com/modx.html
                        My MODX Extras
                        Bob's Guides is now hosted at A2 MODX Hosting