View Issue Details

IDProjectCategoryView StatusLast Update
0005804Composrstatspublic2025-01-05 02:21
ReporterPatrick SchmalstigAssigned ToChris Graham 
SeverityMinor-bug 
Status resolvedResolutionfixed 
Product Version11.beta1 
Fixed in Version 
Summary0005804: Views hook is painfully slow if it was blocked for some time
DescriptionThe views stats hook is very slow when having to process a lot of records (e.g. it was locked out for a while due to an error).

We may need to optimise it further.

On a dedicated server with a calculate_performance_score() of 990,000 uniqid+md5 operations per second... this hook takes about 6 seconds on average for every 1,000 records to process in the main processing loop.

On a relatively quiet site averaging 125 views per day, this translates to 13,000+ records for a 2-month period. The entire hook took 176 seconds to finish.
TagsRoadmap: v11
Time estimation (hours)
Sponsorship open

Activities

admin

2024-07-24 17:02

administrator   ~0008903

Automated message: This issue was created using the Report Issue Wizard on the Composr homesite.

Patrick Schmalstig

2025-01-04 23:36

administrator   ~0009766

Last edited: 2025-01-04 23:37

View 2 revisions

Bumping up to a minor bug. This is causing issues in composr.app . Even though stats are calculated daily, this particular hook is still very slow. Composr.app gets a lot of traffic but not what I'd call "excessive", so the amount of time (60+ seconds sometimes) it takes is concerning.

Patrick Schmalstig

2025-01-05 02:21

administrator   ~0009770

I optimised statistics to hopefully reduce the amount of time necessary to calculate:

 - Scheduler for stats now runs once every hour instead of day to spread out resource use when calculating
 - In addition to only looking back up to 31 days ago, the scheduler will only process stats for up to one day at a time per execution
   - Flat calculations will be skipped if calculating for a previous day and not today (since flat hooks are usually overall stats and not time based)
 - I fixed a few hooks which were not factoring in start and end time like they should have

Issue History

Date Modified Username Field Change
2024-07-24 17:02 Patrick Schmalstig Assigned To => Chris Graham
2024-07-24 17:02 Patrick Schmalstig Status non-assigned => assigned
2024-07-24 17:03 Patrick Schmalstig Description Updated View Revisions
2024-07-24 17:03 Patrick Schmalstig Description Updated View Revisions
2024-07-24 20:58 Chris Graham Tag Attached: Roadmap: v11
2025-01-04 23:36 Patrick Schmalstig Severity Trivial-bug => Minor-bug
2025-01-04 23:36 Patrick Schmalstig Note Added: 0009766
2025-01-04 23:37 Patrick Schmalstig Note Edited: 0009766 View Revisions
2025-01-05 02:21 Patrick Schmalstig Status assigned => resolved
2025-01-05 02:21 Patrick Schmalstig Resolution open => fixed
2025-01-05 02:21 Patrick Schmalstig Note Added: 0009770