Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#17561 closed defect (bug) (duplicate)

Multiple wp-cron processes hammering the server - do we need better semaphore locking?

Reported by: archon810 Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.1.2
Component: Cron API Keywords:
Focuses: Cc:


This ticket is related to my quest of figuring out what is going wrong with my high-traffic server upon publishing - the load usually shoots up and all CPUs start spinning at 100%. I'm using super-cache and lots of other caching and optimizations, and at this point I'm trying to dig deeper.

One thing I noticed during such spikes when everything slows down is multiple POST wp-cron.php?doing_wp_cron processes start showing up in the server-status list. I'm afraid that there is a race condition that only shows up on busy servers, which starts multiple (10+) wp-crons that all start doing the same thing.

For example, due to bug #17560, it's possible that a single wp-cron has lots of useless but busy work to do. When somehow multiple cron jobs start running, they all do this work, making the already loaded situation even worse (load varies from 5-100, but doesn't seem to be directly corellated to the number of people on the site - I've seen higher load with 1/5 the amount of people before).

Because the server has high-traffic, I'm considering adding an if statement that would only run cron 1 out of 100 times, but that's a dirty hack.

Please chime in, core devs. I'd love to hear your input. This has plagued Wordpress since before v3.

Thank you.

Change History (4)

#1 @archon810
11 years ago

  • Cc admin@… added

#2 @nacin
11 years ago

This belongs in a support forum.

#3 @scribu
11 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Also: #17462

#4 @archon810
11 years ago

@nacin, this is a bug in Wordpress, IMO, so it belongs in the bug tracker.

@scribu, perfect, thank you. Looks like you guys realized it's a problem recently already.

Note: See TracTickets for help on using tickets.