Skip to content
This repository has been archived by the owner on Mar 8, 2021. It is now read-only.

website hanging or very slow after upgrade from 1.0.12 to 1.0.14 #282

Closed
nick0 opened this issue Jun 24, 2014 · 7 comments
Closed

website hanging or very slow after upgrade from 1.0.12 to 1.0.14 #282

nick0 opened this issue Jun 24, 2014 · 7 comments

Comments

@nick0
Copy link

nick0 commented Jun 24, 2014

Hello,

Further to this post: http://forums.modx.com/thread/91469/hostgator-shutdown-site-for-high-cpu-abuse-after-upgrade-to-1-0-14, I also had a hosting account suspended by the web host because a recently upgraded 1.0.14 site was hanging (it was either indefintetly loading until the browser's timeout error was returned, or eventually loading after a very long time).

I think this may be related to Wayfinder.

The site was upgraded from 1.0.12 to 1.0.14.

Per a github issue I read about for wayfinder, I disabled wayfinder and the site was fast again. All the levels were set in the wayfinder menus and most were only to 1 or 2 so not sure why it was a problem.

I reverted the actual site back to 1.0.12 - and the website loading speed is fine yet again.

So I setup a site copy on a different server for testing.

I am using just the home page for the test results...

1.0.12 home page of the actual site (I had to revert the upgrade back to 1.0.12):
0.4987 s - Query Time - Shows how long MODx took talking to the database
67 - Query Count -Shows how many database queries MODx made
0.6591 s - Parse Time - Shows how long MODx took to parse the page
1.1578 s - Total Time - Shows the total time taken to parse/ render the page
database - Source - Shows the source of page, whether is database or cache

default wayfinder (2.0.2) enabled: testing the 1.0.14 home page of the site on a different domain on the same shared server:

5.2706 s - Query Time - Shows how long MODx took talking to the database
67 - Query Count -Shows how many database queries MODx made
17.4226 s - Parse Time - Shows how long MODx took to parse the page
22.6931 s - Total Time - Shows the total time taken to parse/ render the page
database - Source - Shows the source of page, whether is database or cache

default wayfinder (2.0.2) disabled: testing the 1.0.14 home page of the site on a different domain on the same shared server:

0.4010 s - Query Time - Shows how long MODx took talking to the database
62 - Query Count -Shows how many database queries MODx made
0.4930 s - Parse Time - Shows how long MODx took to parse the page
0.8940 s - Total Time - Shows the total time taken to parse/ render the page
database - Source - Shows the source of page, whether is database or cache

It seems way quicker with wayfinder 2.0.2 disabled.

wayfinder 2.0.1 (distributed with 1.0.12) enabled instead of wayfinder 2.0.2 (distributed with 1.0.14) - testing the 1.0.14 home page of the site on a different domain on the same shared server:

0.4761 s - Query Time - Shows how long MODx took talking to the database
68 - Query Count -Shows how many database queries MODx made
0.6654 s - Parse Time - Shows how long MODx took to parse the page
1.1415 s - Total Time - Shows the total time taken to parse/ render the page
database - Source - Shows the source of page, whether is database or cache

And seems fine with wayfinder 2.0.1 enabled.


Nothing complex is happening with Wayfinder, and speed is fine in 1.0.12. These are the Wayfinder calls on the page...

Main menu:
this is a drop down menu - level 1 is top level, second level is the drop down
this retrieves 55 docs (10 top level, 45 second level)

[[Wayfinder?
&startId=`0`
&level=`2`
&firstClass=`first`
&textOfLinks=`menutitle`
&titleOfLinks=`pagetitle`
&outerTpl=`main-menu-wrapper`
&rowTpl=`main-menu-row`
&innerRowTpl=`main-menu-row-inner`
&excludeDocs=`1,4,5,7,8,6,157,169,1246,1247`
]]

main-menu-wrapper:

  <ul>
[+wf.wrapper+]
  </ul>

main-menu-row:

<li[+wf.classes+]><a href="[+wf.link+]" title="[+wf.title+]"[+wf.attributes+]><span>[+wf.linktext+]</span></a>[+wf.wrapper+]</li>

main-menu-row-inner:

<li[+wf.classes+]><a href="[+wf.link+]" title="[+wf.title+]"[+wf.attributes+]>[+wf.linktext+]</a></li>

Fat footer used which contains 5 single level wayfinder menus:

1:

[[Wayfinder?
&startId=`1213`
&level=`2`
&displayStart=`true`
&startItemTpl=`footer-menu-starter`
&outerTpl=`footer-menu-wrapper2`
&rowTpl=`footer-menu-row`
&sortBy=`menuindex`
&excludeDocs=`1245`
]]

this retrieves 6 docs (1 start level, 5 second level)

2:

[[Wayfinder?
&startId=`17`
&level=`2`
&displayStart=`true`
&startItemTpl=`footer-menu-starter`
&outerTpl=`footer-menu-wrapper2`
&rowTpl=`footer-menu-row`
&sortBy=`menuindex`
]]

this retrieves 9 docs (1 start level, 8 second level)

3:

[[Wayfinder?
&startId=`14`
&level=`2`
&displayStart=`true`
&startItemTpl=`footer-menu-starter`
&outerTpl=`footer-menu-wrapper2`
&rowTpl=`footer-menu-row`
&sortBy=`menuindex`
&excludeDocs=`157`
]]

this retrieves 5 docs (1 start level, 4 second level)

4:

[[Wayfinder?
&startId=`93`
&level=`2`
&displayStart=`true`
&startItemTpl=`footer-menu-starter`
&outerTpl=`footer-menu-wrapper2`
&rowTpl=`footer-menu-row`
&sortBy=`menuindex`
]]

this retrieves 7 docs (1 start level, 6 second level)

5:

[[Wayfinder?
&startId=`0`
&level=`2`
&ignoreHidden=`true`
&outerTpl=`footer-menu-wrapper`
&rowTpl=`footer-menu-row`
&sortBy=`menuindex`
&includeDocs=`1,4,1246,1247`
]]

this retrieves 4 docs

footer-menu-starter:

<h2><a href="[+wf.link+]" title="[+wf.title+]">[+wf.linktext+]</a></h2>
[+wf.wrapper+]

footer-menu-wrapper2:

<ul>
[+wf.wrapper+]
</ul>

footer-menu-wrapper:

[+wf.wrapper+]

footer-menu-row:

<li><a href="[+wf.link+]" title="[+wf.title+]">[+wf.linktext+]</a></li>

Any ideas?

Thanks in advance.

@Jako
Copy link
Contributor

Jako commented Jun 24, 2014

Maybe it is a memory issue. Could you first try to comment out this lines: https://github.com/modxcms/evolution/blob/bugfix/assets/snippets/wayfinder/wayfinder.inc.php#L220-L223

@nick0
Copy link
Author

nick0 commented Jun 24, 2014

Sure thing, thanks Jako.

I commented out those lines in Wayfinder 2.0.2 and renabled it.

Results are much better...

0.4115 s - Query Time - Shows how long MODx took talking to the database
68 - Query Count -Shows how many database queries MODx made
0.8161 s - Parse Time - Shows how long MODx took to parse the page
1.2276 s - Total Time - Shows the total time taken to parse/ render the page
database - Source - Shows the source of page, whether is database or cache

Please advise if you need any more testing.

@Jako
Copy link
Contributor

Jako commented Jun 24, 2014

Ok. Try to exclude only the content field …

foreach ($resource as $dvName => $dvVal) {
    if ($dvName != 'content') {
        $this->placeHolders['rowLevel'][] = "[+" . $dvName . "+]";
        $phArray[] = $dvVal;
    }
}

@nick0
Copy link
Author

nick0 commented Jun 24, 2014

Thanks Jako.

I tried that updated code to exclude only the content field.

For each test, I cleared the cache in the manager and pressed shift button and refresh in the front end page.

The results vary quite a lot - they are considerably slower than your first suggestion (commenting out the lines).

test 1 on the different domain on the same shared server:

1.2016 s - Query Time - Shows how long MODx took talking to the database
67 - Query Count -Shows how many database queries MODx made
6.4336 s - Parse Time - Shows how long MODx took to parse the page
7.6352 s - Total Time - Shows the total time taken to parse/ render the page
database - Source - Shows the source of page, whether is database or cache

test 2 on the different domain on the same shared server:

.0037 s - Query Time - Shows how long MODx took talking to the database
68 - Query Count -Shows how many database queries MODx made
7.0464 s - Parse Time - Shows how long MODx took to parse the page
13.0501 s - Total Time - Shows the total time taken to parse/ render the page
database - Source - Shows the source of page, whether is database or cache

test 3 on the different domain on the same shared server:

0.4313 s - Query Time - Shows how long MODx took talking to the database
67 - Query Count -Shows how many database queries MODx made
5.9457 s - Parse Time - Shows how long MODx took to parse the page
6.3770 s - Total Time - Shows the total time taken to parse/ render the page
database - Source - Shows the source of page, whether is database or cache

test 4 on the different domain on the same shared server:

1.3788 s - Query Time - Shows how long MODx took talking to the database
67 - Query Count -Shows how many database queries MODx made
9.4387 s - Parse Time - Shows how long MODx took to parse the page
10.8175 s - Total Time - Shows the total time taken to parse/ render the page
database - Source - Shows the source of page, whether is database or cache

test 5 on the different domain on the same shared server:

0.4179 s - Query Time - Shows how long MODx took talking to the database
67 - Query Count -Shows how many database queries MODx made
5.8897 s - Parse Time - Shows how long MODx took to parse the page
6.3076 s - Total Time - Shows the total time taken to parse/ render the page
database - Source - Shows the source of page, whether is database or cache

test 6 on the different domain on the same shared server:

0.4872 s - Query Time - Shows how long MODx took talking to the database
67 - Query Count -Shows how many database queries MODx made
6.8118 s - Parse Time - Shows how long MODx took to parse the page
7.2990 s - Total Time - Shows the total time taken to parse/ render the page
database - Source - Shows the source of page, whether is database or cache

Thanks Jako.

@Jako
Copy link
Contributor

Jako commented Jun 25, 2014

Duplicate of #226

@Jako Jako closed this as completed Jun 25, 2014
@Jako
Copy link
Contributor

Jako commented Jun 25, 2014

Please test the fix: 102fe60

@nick0
Copy link
Author

nick0 commented Jun 25, 2014

Thank you Jako.

That seems to have done the trick! Wonderful work.

test 1 on the different domain on the same shared server - 1.0.14 with modified Wayfinder 2.0.2:
0.4335 s - Query Time - Shows how long MODx took talking to the database
68 - Query Count -Shows how many database queries MODx made
0.7051 s - Parse Time - Shows how long MODx took to parse the page
1.1386 s - Total Time - Shows the total time taken to parse/ render the page
database - Source - Shows the source of page, whether is database or cache

test 2 on the different domain on the same shared server - 1.0.14 with modified Wayfinder 2.0.2:
0.6779 s - Query Time - Shows how long MODx took talking to the database
67 - Query Count -Shows how many database queries MODx made
0.7018 s - Parse Time - Shows how long MODx took to parse the page
1.3798 s - Total Time - Shows the total time taken to parse/ render the page
database - Source - Shows the source of page, whether is database or cache

test 1 on actual site - 1.0.14 with Wayfinder 2.0.3
0.5563 s - Query Time - Shows how long MODx took talking to the database
68 - Query Count -Shows how many database queries MODx made
0.7240 s - Parse Time - Shows how long MODx took to parse the page
1.2802 s - Total Time - Shows the total time taken to parse / render the page
database - Source - Shows the source of page, whether is database or cache

test 2 on actual site - 1.0.14 with Wayfinder 2.0.3
0.5019 s - Query Time - Shows how long MODx took talking to the database
68 - Query Count -Shows how many database queries MODx made
0.7152 s - Parse Time - Shows how long MODx took to parse the page
1.2171 s - Total Time - Shows the total time taken to parse / render the page
database - Source - Shows the source of page, whether is database or cache

Speed looks good to me.

Thanks for addressing this so quickly Jako.

Deesen pushed a commit to Deesen/evolution that referenced this issue Oct 25, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants