Author Topic: Page Loading Timeouts  (Read 4680 times)

Blondeshell

  • Elite Boss
  • *****
  • Posts: 791
Page Loading Timeouts
« on: July 03, 2012, 07:23:22 PM »
I know that some large pages can take a few seconds to load, either for viewing or editing, but I'm having difficulty getting the Store-Bought Enhancements page to load at all.  I get various errors like these:

Fatal error: Maximum execution time of 30 seconds exceeded in /var/www/cohtitan.com/wiki/public_html/w/includes/parser/Parser.php on line 3528
Fatal error: Maximum execution time of 30 seconds exceeded in /var/www/cohtitan.com/wiki/public_html/w/includes/parser/Preprocessor_DOM.php on line 1099
Fatal error: Maximum execution time of 30 seconds exceeded in /var/www/cohtitan.com/wiki/public_html/w/extensions/ParserFunctions/Expr.php on line 223
Fatal error: Maximum execution time of 30 seconds exceeded in /var/www/cohtitan.com/wiki/public_html/w/includes/parser/Preprocessor_DOM.php on line 882

...and so on.

Does anyone else have any problems getting that page to load? Is it possibly related to switching to SemanticWiki instead of DPL?  For reference, I'm using IE8 and I've restarted the browser and cleared my cache.

Cannonfodder

  • Lieutenant
  • ***
  • Posts: 84
Re: Page Loading Timeouts
« Reply #1 on: July 03, 2012, 09:19:26 PM »
Not just you.

Fatal error: Maximum execution time of 30 seconds exceeded in /var/www/cohtitan.com/wiki/public_html/w/includes/parser/Preprocessor_DOM.php on line 998
--Jason
@Cannonfodder
Victory:  Cannonfodder 50 Inv/SS
Virtue:  Pravda 50 Bots/FF
The Hall of Justice/The Hall of Doom /chanjoin "Victory Badges" /chanjoin "Virtue Badges"

eabrace

  • Titan Moderator
  • Elite Boss
  • *****
  • Posts: 4,230
Re: Page Loading Timeouts
« Reply #2 on: July 03, 2012, 09:36:00 PM »
Yep.  I appear to be having issues trying to load that one, too.

Code: [Select]
Fatal error: Maximum execution time of 30 seconds exceeded in /var/www/cohtitan.com/wiki/public_html/w/includes/parser/Preprocessor_DOM.php on line 905
If I pick the page apart in Edit mode, I can display everything up through the max level 40 sets, but somewhere in the middle of loading up the max level 50 sets is where it goes sour.
Titan Twitter broadcasting at 5.000 mWh and growing.
Titan Facebook

Paragon Wiki admin
I was once being interviewed by Barbara Walters...In between two of the segments she asked me..."But what would you do if the doctor gave you only six months to live?" I said, "Type faster." - Isaac Asimov

Sekoia

  • Titan Network Admin
  • Elite Boss
  • *****
  • Posts: 1,828
Re: Page Loading Timeouts
« Reply #3 on: July 04, 2012, 03:28:03 PM »
I just disabled SMW temporarily and the page still isn't loading, so it isn't SMW's fault. I also tried disabling Labeled Section Transclusion and it wasn't its fault either. I then tried disabling DPL and ParserFunctions, and neither of them let it work either.

Unfortunately, my area is afflicted with major power outages so my only internet at the moment is via a limited, slow cell tether, so I can't look into this further at the moment. If nobody else finds a solution, I can probably investigate further this weekend. (They expect to have power mostly restored by Friday night.)

Blondeshell

  • Elite Boss
  • *****
  • Posts: 791
Re: Page Loading Timeouts
« Reply #4 on: July 04, 2012, 05:00:30 PM »
Thanks for checking into it, sir.  Sorry to hear you've been one of the many without power this week.

eabrace

  • Titan Moderator
  • Elite Boss
  • *****
  • Posts: 4,230
Re: Page Loading Timeouts
« Reply #5 on: July 04, 2012, 06:17:56 PM »
I'm going to attempt something which I do not expect to work.  But it just might be crazy enough...
Titan Twitter broadcasting at 5.000 mWh and growing.
Titan Facebook

Paragon Wiki admin
I was once being interviewed by Barbara Walters...In between two of the segments she asked me..."But what would you do if the doctor gave you only six months to live?" I said, "Type faster." - Isaac Asimov

eabrace

  • Titan Moderator
  • Elite Boss
  • *****
  • Posts: 4,230
Re: Page Loading Timeouts
« Reply #6 on: July 04, 2012, 06:45:41 PM »
... nope.  Didn't work.

I tried creating subpages for each of the "Max Level X" sections and transcluding them, hoping that it would count each transclusion as a separate page load.  It does not, so it still times out.

However, that did give me another idea.  I've created subpages for each of the sections to allow people to continue accessing the information until we can find a solution to the timeout.  I've also added an EdNote to the page to let everyone know what's going on.
Titan Twitter broadcasting at 5.000 mWh and growing.
Titan Facebook

Paragon Wiki admin
I was once being interviewed by Barbara Walters...In between two of the segments she asked me..."But what would you do if the doctor gave you only six months to live?" I said, "Type faster." - Isaac Asimov

Sekoia

  • Titan Network Admin
  • Elite Boss
  • *****
  • Posts: 1,828
Re: Page Loading Timeouts
« Reply #7 on: July 05, 2012, 12:56:38 PM »
I tried the following:
- Restarted Apache
- Restarted MySQL
- Temporarily disabled every extension except Titan Authentication
- Temporarily simplified constants in PP2EUR and PP2GBP
- Split off documentation in various templates used so that pre-parsed template transclusion was smaller
- Tried manually replacing {{Table End}} with |} in the article's text
- Optimized all database tables and verified that none needed to be repaired

None of that worked. I do notice however that the wiki seems to be running fairly slowly, and continued to run slowly regardless of what I tried.

I could perhaps raise the script limit from 30 seconds, but that seems unwise. We really shouldn't have pages that take 30 seconds or more to run. Something changed that made this stop working and I don't think it was the article itself. Unfortunately, I'm at a loss for what it might be.
« Last Edit: July 05, 2012, 01:14:26 PM by Sekoia »

Blondeshell

  • Elite Boss
  • *****
  • Posts: 791
Re: Page Loading Timeouts
« Reply #8 on: July 17, 2012, 05:52:04 PM »
I think I might have a clue as to what is causing these pages to load and save slowly.

While adding the market sale items for this week, I put "N/A" as the sale parameter for the Bats Aura, and got a whole host of error messages:



Upon digging into it, I realized those errors didn't have anything to do with the currency conversion templates themselves, but rather with the Decimals Template. Is it possible that the pages are slow becaue they have to churn through all of the #if checks for each currency value? Is there anything that can be done to simplify the rounding process and maybe speed things up?

eabrace

  • Titan Moderator
  • Elite Boss
  • *****
  • Posts: 4,230
Re: Page Loading Timeouts
« Reply #9 on: July 17, 2012, 06:03:08 PM »
Holy cow, that's hard to read.  I made it a little more readable.

Code: [Select]
{{#ifexpr: {{{2}}}<=0
  | {{#expr:{{{1}}} round {{{2}}}}}
  | {{#expr:{{{1}}} round {{#ifexpr: {{{2}}}>12
    |12
    |{{{2}}}
    }}
  }}
  {{#ifexpr: ({{{2}}}>=1) and (({{{1}}} round 0)=({{{1}}} round {{{2}}}))
    |.0
    |
  }}
  {{#ifexpr: ({{{2}}}>=2) and (({{{1}}} round 1)=({{{1}}} round {{{2}}}))
    |0
    |
  }}
  {{#ifexpr: ({{{2}}}>=3) and (({{{1}}} round 2)=({{{1}}} round {{{2}}}))
    |0
    |
  }}
  {{#ifexpr: ({{{2}}}>=4) and (({{{1}}} round 3)=({{{1}}} round {{{2}}}))
    |0
    |
  }}
  {{#ifexpr: ({{{2}}}>=5) and (({{{1}}} round 4)=({{{1}}} round {{{2}}}))
    |0
    |
  }}
  {{#ifexpr: ({{{2}}}>=6) and (({{{1}}} round 5)=({{{1}}} round {{{2}}}))
    |0
    |
  }}
  {{#ifexpr: ({{{2}}}>=7) and (({{{1}}} round 6)=({{{1}}} round {{{2}}}))
    |0
    |
  }}
  {{#ifexpr: ({{{2}}}>=8) and (({{{1}}} round 7)=({{{1}}} round {{{2}}}))
    |0
    |
  }}
  {{#ifexpr: ({{{2}}}>=9) and (({{{1}}} round 8)=({{{1}}} round {{{2}}}))
    |0
    |
  }}
  {{#ifexpr: ({{{2}}}>=10) and (({{{1}}} round 9)=({{{1}}} round {{{2}}}))
    |0
    |
  }}
  {{#ifexpr: ({{{2}}}>=11) and (({{{1}}} round 10)=({{{1}}} round {{{2}}}))
    |0
    |
  }}
  {{#ifexpr: ({{{2}}}>=12) and (({{{1}}} round 11)=({{{1}}} round {{{2}}}))
    |0
    |
  }}
}}

My gut says that there should be a way to optimize all of those "#ifexpr: ({{{2}}}>=" statements.

Edit:  Are those only counting out the number of decimals we want to round to?  If so, do we really need to go beyond 2?  Does the template ever get parsed beyond 2 to begin with?
Titan Twitter broadcasting at 5.000 mWh and growing.
Titan Facebook

Paragon Wiki admin
I was once being interviewed by Barbara Walters...In between two of the segments she asked me..."But what would you do if the doctor gave you only six months to live?" I said, "Type faster." - Isaac Asimov

eabrace

  • Titan Moderator
  • Elite Boss
  • *****
  • Posts: 4,230
Re: Page Loading Timeouts
« Reply #10 on: July 17, 2012, 06:43:41 PM »
I have something to try out, but it'll take me a few to finish typing it all out and then remove the extra whitespace...
Titan Twitter broadcasting at 5.000 mWh and growing.
Titan Facebook

Paragon Wiki admin
I was once being interviewed by Barbara Walters...In between two of the segments she asked me..."But what would you do if the doctor gave you only six months to live?" I said, "Type faster." - Isaac Asimov

eabrace

  • Titan Moderator
  • Elite Boss
  • *****
  • Posts: 4,230
Re: Page Loading Timeouts
« Reply #11 on: July 17, 2012, 06:50:26 PM »
Code: [Select]
{{#ifexpr: {{{2}}}<=0
  | {{#expr:{{{1}}} round {{{2}}}}}
  | {{#expr:{{{1}}} round {{#ifexpr: {{{2}}}>12
    |12
    |{{{2}}}
    }}
  }}
  {{#ifexpr: ({{{2}}}>=1)
    {{#ifexpr: (({{{1}}} round 0)=({{{1}}} round {{{2}}}))
      |.0
      |
    }}
    {{#ifexpr: ({{{2}}}>=2)
      {{#ifexpr: (({{{1}}} round 1)=({{{1}}} round {{{2}}}))
        |0
        |
      }}
      {{#ifexpr: ({{{2}}}>=3)
        {{#ifexpr: (({{{1}}} round 2)=({{{1}}} round {{{2}}}))
          |0
          |
        }}
        {{#ifexpr: ({{{2}}}>=4)
          {{#ifexpr: (({{{1}}} round 3)=({{{1}}} round {{{2}}}))
            |0
            |
          }}
          {{#ifexpr: ({{{2}}}>=5)
            {{#ifexpr: (({{{1}}} round 4)=({{{1}}} round {{{2}}}))
              |0
              |
            }}
            {{#ifexpr: ({{{2}}}>=6)
              {{#ifexpr: (({{{1}}} round 5)=({{{1}}} round {{{2}}}))
                |0
                |
              }}
              {{#ifexpr: ({{{2}}}>=7)
                {{#ifexpr: (({{{1}}} round 6)=({{{1}}} round {{{2}}}))
                  |0
                  |
                }}
                {{#ifexpr: ({{{2}}}>=8)
                  {{#ifexpr: (({{{1}}} round 7)=({{{1}}} round {{{2}}}))
                    |0
                    |
                  }}
                  {{#ifexpr: ({{{2}}}>=9)
                    {{#ifexpr: (({{{1}}} round 8)=({{{1}}} round {{{2}}}))
                      |0
                      |
                    }}
                    {{#ifexpr: ({{{2}}}>=10)
                      {{#ifexpr: (({{{1}}} round 9)=({{{1}}} round {{{2}}}))
                        |0
                        |
                      }}
                      {{#ifexpr: ({{{2}}}>=11)
                        {{#ifexpr: (({{{1}}} round 10)=({{{1}}} round {{{2}}}))
                          |0
                          |
                        }}
                        {{#ifexpr: ({{{2}}}>=12)
                          {{#ifexpr: (({{{1}}} round 11)=({{{1}}} round {{{2}}}))
                            |0
                            |
                          }}
                        }}
                      }}
                    }}
                  }}
                }}
              }}
            }}
          }}
        }}
      }}
    }}
  }}
}}
Hopefully, this will stop plowing through the #ifexpr: statements on the third check (">=3").  That's a whole lot fewer checks than having to indiscriminately plowing through all 12 every time.

Edit:  There are pipes ('|') missing after each >= check above.  I added them all (I think) when I modified the template.
« Last Edit: July 17, 2012, 06:58:09 PM by eabrace »
Titan Twitter broadcasting at 5.000 mWh and growing.
Titan Facebook

Paragon Wiki admin
I was once being interviewed by Barbara Walters...In between two of the segments she asked me..."But what would you do if the doctor gave you only six months to live?" I said, "Type faster." - Isaac Asimov

Sekoia

  • Titan Network Admin
  • Elite Boss
  • *****
  • Posts: 1,828
Re: Page Loading Timeouts
« Reply #12 on: July 17, 2012, 07:06:08 PM »
I just installed the NumberFormat extension which gives a parser function that does this. It's much more efficient to do this kind of thing in PHP directly than in complicated templates. Hopefully that'll help.

Edit: That now lets Store-Bought Enhancements page load properly so I restored it to the full listing.
« Last Edit: July 17, 2012, 07:11:56 PM by Sekoia »

Blondeshell

  • Elite Boss
  • *****
  • Posts: 791
Re: Page Loading Timeouts
« Reply #13 on: July 17, 2012, 07:28:25 PM »
It looks like that was the culprit. The regular Paragon Market and /Sales pages also load faster now.

eabrace

  • Titan Moderator
  • Elite Boss
  • *****
  • Posts: 4,230
Re: Page Loading Timeouts
« Reply #14 on: July 17, 2012, 07:56:22 PM »
Had to run to a training class for an hour right after I made the change.  Realized as I was sitting there I missed a few pipes

{{#ifexpr: <expression>|<true>|<false>}}

But hey, I'll take an OBE win.  :)
Titan Twitter broadcasting at 5.000 mWh and growing.
Titan Facebook

Paragon Wiki admin
I was once being interviewed by Barbara Walters...In between two of the segments she asked me..."But what would you do if the doctor gave you only six months to live?" I said, "Type faster." - Isaac Asimov