Closed Bug 429529 Opened 16 years ago Closed 16 years ago

Do not calculate page ranks every time /tiki-wiki_rankings.php is loaded

Categories

(support.mozilla.org :: General, defect)

defect
Not set
critical

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: laura, Unassigned)

Details

(Whiteboard: tiki_bug, tiki_upstreamed)

Attachments

(1 file)

This page is linked from the homepage.  The pagerank calculation queries are bringing the database to its knees.
We'll also need a cron job to calculate these periodically.
Attachment #316264 - Flags: review?(nelson)
Attachment #316264 - Flags: review?(nelson) → review+
Committed patch in r12362.
Pushed.
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Whiteboard: tiki_bug
Removing the function call solves the performance problem, but this one cannot be upstreamed directly.

It's quite a nasty function however and really does not deserve to be called every time.

I see three options:
* Run it as part of editpage. Because ranking is based on links, it should not vary any more than that. However, I saw quite a few problems with that page being too slow already.
* Run it on demand, but set a timeout on it so it only runs like once an hour (configurable).
* Let it run from cron. This cannot be the only option for the other installations.

Any input?
James or morgamic: any input on the best approach here?
Whiteboard: tiki_bug → tiki_bug, tiki_discuss
tiki-editpage.php already times out, so the first option should be avoided if at all possible.
The cron option works well for us--but do we really use this feature?--with the on-demand option being the most universal.
I suggest creating an admin panel for perf preferences, having those off by default. In turn, SUMO would turn them on. One of those prefs would cause the piece of code in question here to not be executed, while the admin option would make sure to mention "Note: enabling this breaks this functionality"
Paul's solution works, but there needs to be a mechanism to trigger the calculation. Either an on-demand option, the cron, or perhaps something like a random integer, 1-1000 and if you roll a 1, calculate the ranks.
Whiteboard: tiki_bug, tiki_discuss → tiki_bug
Used the dice roll approach. Limit can be changed using a preference. Using 1000 by default.
Whiteboard: tiki_bug → tiki_bug, tiki_upstreamed
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: