#5804 - Views hook is painfully slow if it was blocked for some time
| Identifier | #5804 |
|---|---|
| Issue type | Minor issue (breaks specific functionality) |
| Title | Views hook is painfully slow if it was blocked for some time |
| Status | Completed |
| Tags |
Roadmap: v11 (custom) |
| Handling member | Chris Graham |
| Version | 11 beta1 |
| Addon | stats |
| Description | The 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. |
| Steps to reproduce | |
| Funded? | No |
The system will post a comment when this issue is modified (e.g., status changes). To be notified of this, click "Enable comment notifications".
Comments
- 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