WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#25833 closed defect (bug) (fixed)

Background Updates should be spread over the hour

Reported by: dd32 Owned by: dd32
Milestone: 3.7.2 Priority: normal
Severity: normal Version: 3.7
Component: Upgrade/Install Keywords: has-patch commit fixed-major
Focuses: Cc:

Description

In 3.7 the background updates are scheduled for exactly 7am/7pm local-time, this causes many hundreds of thousands of sites to attempt performing updates on-the-hour.

This also means that we now have millions of sites running their update checks in 12 timeslots (or as close to it as they can get) rather than spread over all the minutes in the hour (12 * 60).

We should make Background Updates occur at a random minute of the hour instead to spread the load out, not only for WordPress.org, but for shared hosts whose disks suddenly receive a higher than normal amount of file writes.

Initially my thought is that we do 7am/7pm+ rand(0,59).
We could also do 6.30 + rand(0,59) to spread it from 6.30 -> 7.30 if we want to keep it around the 7 o'clock slot.

Attachments (2)

25833.diff (1.8 KB) - added by pento 8 years ago.
25833.2.diff (1.6 KB) - added by pento 8 years ago.

Download all attachments as: .zip

Change History (9)

@pento
8 years ago

#1 @pento
8 years ago

  • Keywords has-patch added; needs-patch removed

#2 @pento
8 years ago

I went with 7+rand(0,59), because it's neater, and we're not attached to exactly 7/7, per nacin:

https://twitter.com/nacin/status/397562460301172736

#3 @dd32
8 years ago

I'm thinking it might be better to attach the minutes after the loop to find the next 7 o'clock, that way the "not within the next 3 hours" line remains correct.

@pento
8 years ago

#4 @pento
8 years ago

attachment:25833.2.diff

I'm not sure it matters whether it's "not within the next 3 hours" or "not within the next 2-3 hours", but for the sake of making the diff 0.2KB smaller, let's go with it.

#5 @dd32
8 years ago

  • Owner set to dd32
  • Resolution set to fixed
  • Status changed from new to closed

In 26149:

Background Updates: Spread them over the hour. Props Pento. Fixes #25833 for trunk

#6 @dd32
8 years ago

  • Keywords commit fixed-major added
  • Resolution fixed deleted
  • Status changed from closed to reopened

#7 @dd32
8 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 26450:

Background Updates: Spread them over the hour. Props Pento. Merges r26149 to the 3.7 branch. Fixes #25833 for 3.7.

Note: See TracTickets for help on using tickets.