[wp-trac] Re: [WordPress Trac] #3713: Missing wp-cron.php might put huge stress on the Server

WordPress Trac wp-trac at lists.automattic.com
Tue Jan 30 15:52:12 GMT 2007


#3713: Missing wp-cron.php might put huge stress on the Server
-------------------------------------------------------------------------------+
 Reporter:  Jan                                                                |        Owner:  anonymous
     Type:  defect                                                             |       Status:  reopened 
 Priority:  high                                                               |    Milestone:  2.1.1    
Component:  General                                                            |      Version:  2.1      
 Severity:  critical                                                           |   Resolution:           
 Keywords:  has-patch wp-cron cron recursive call heavy load server scheduler  |  
-------------------------------------------------------------------------------+
Old description:

> It happened to me when I forgot uploading wp-cron.php after updating to
> 2.1.
>
> The Scheduler tried to reach wp-cron.php which wasn't found. The request
> was therefore directed to index.php, recursively triggering the scheduler
> again.
>
> I noticed when I received a mail from my hoster about shutting my site
> down because it caused too much load on the server.
>
> Now this shouldn't happen under normal circumstances but the effect is
> quite severe ''when'' it happens. Issues with .htaccess could cause this
> too. I haven't completely checked out the cron mechanism yet but this
> seems weakly designed somehow.
>
> A quick solution that comes to my mind right now would be to check for
> the GET Path before triggering the call to the wp-cron.php. If we are
> already handling a wp-cron request, something must have gone wrong and
> wp-cron should not be called again in the current session.
> This is an ugly hack, I hope someone comes up with something smarter.
>
> EXAMPLE OF SYMPTOM:
>
> mar jan 30 11:22:45 CET 2007 : sainteli04 : Query 12 SELECT option_name,
> option_value FROM cv_options WHERE autoload =
> 'yes'                              |
> mar jan 30 11:22:45 CET 2007 : sainteli04 : Query 12 SELECT option_name,
> option_value FROM cv_options WHERE autoload =
> 'yes'                              |
> mar jan 30 11:22:45 CET 2007 : sainteli04 : Query 12 SELECT option_name,
> option_value FROM cv_options WHERE autoload =
> 'yes'                              |
> mar jan 30 11:22:45 CET 2007 : sainteli04 : Query 12 SELECT option_name,
> option_value FROM cv_options WHERE autoload =
> 'yes'                              |
> mar jan 30 11:22:45 CET 2007 : sainteli04 : Query 11 SELECT option_value
> FROM cv_options WHERE option_name =
> 'siteurl'                                    |
> mar jan 30 11:22:47 CET 2007 : sainteli04 : Killed 15 SELECT   cv_posts.*
> FROM cv_posts  WHERE 1=1  AND post_name = 'wp-cronphp' AND (post_type =
> 'post')  |
> mar jan 30 11:22:47 CET 2007 : sainteli04 : Killed 15 SELECT   cv_posts.*
> FROM cv_posts  WHERE 1=1  AND post_name = 'wp-cronphp' AND (post_type =
> 'post')  |
> mar jan 30 11:22:47 CET 2007 : sainteli04 : Killed 15 SELECT   cv_posts.*
> FROM cv_posts  WHERE 1=1  AND post_name = 'wp-cronphp' AND (post_type =
> 'post')  |
> mar jan 30 11:22:47 CET 2007 : sainteli04 : Killed 15 SELECT option_name,
> option_value FROM cv_options WHERE autoload =
> 'yes'                              |
> mar jan 30 11:22:50 CET 2007 : sainteli04 : Killed 17 SELECT   cv_posts.*
> FROM cv_posts  WHERE 1=1  AND post_name = 'wp-cronphp' AND (post_type =
> 'post')  |
> mar jan 30 11:22:50 CET 2007 : sainteli04 : Killed 17 SELECT   cv_posts.*
> FROM cv_posts  WHERE 1=1  AND post_name = 'wp-cronphp' AND (post_type =
> 'post')  |
> mar jan 30 11:22:50 CET 2007 : sainteli04 : Killed 17 SELECT   cv_posts.*
> FROM cv_posts  WHERE 1=1  AND post_name = 'wp-cronphp' AND (post_type =
> 'post')  |
> mar jan 30 11:22:50 CET 2007 : sainteli04 : Killed 17 SELECT option_name,
> option_value FROM cv_options WHERE autoload =
> 'yes'                              |

New description:

 It happened to me when I forgot uploading wp-cron.php after updating to
 2.1.

 The Scheduler tried to reach wp-cron.php which wasn't found. The request
 was therefore directed to index.php, recursively triggering the scheduler
 again.

 I noticed when I received a mail from my hoster about shutting my site
 down because it caused too much load on the server.

 Now this shouldn't happen under normal circumstances but the effect is
 quite severe ''when'' it happens. Issues with .htaccess could cause this
 too. I haven't completely checked out the cron mechanism yet but this
 seems weakly designed somehow.

 A quick solution that comes to my mind right now would be to check for the
 GET Path before triggering the call to the wp-cron.php. If we are already
 handling a wp-cron request, something must have gone wrong and wp-cron
 should not be called again in the current session.
 This is an ugly hack, I hope someone comes up with something smarter.

 EXAMPLE OF SYMPTOM:

 {{{
 mar jan 30 11:22:45 CET 2007 : sainteli04 : Query 12 SELECT option_name,
 option_value FROM cv_options WHERE autoload =
 'yes'                              |
 mar jan 30 11:22:45 CET 2007 : sainteli04 : Query 12 SELECT option_name,
 option_value FROM cv_options WHERE autoload =
 'yes'                              |
 mar jan 30 11:22:45 CET 2007 : sainteli04 : Query 12 SELECT option_name,
 option_value FROM cv_options WHERE autoload =
 'yes'                              |
 mar jan 30 11:22:45 CET 2007 : sainteli04 : Query 12 SELECT option_name,
 option_value FROM cv_options WHERE autoload =
 'yes'                              |
 mar jan 30 11:22:45 CET 2007 : sainteli04 : Query 11 SELECT option_value
 FROM cv_options WHERE option_name =
 'siteurl'                                    |
 mar jan 30 11:22:47 CET 2007 : sainteli04 : Killed 15 SELECT   cv_posts.*
 FROM cv_posts  WHERE 1=1  AND post_name = 'wp-cronphp' AND (post_type =
 'post')  |
 mar jan 30 11:22:47 CET 2007 : sainteli04 : Killed 15 SELECT   cv_posts.*
 FROM cv_posts  WHERE 1=1  AND post_name = 'wp-cronphp' AND (post_type =
 'post')  |
 mar jan 30 11:22:47 CET 2007 : sainteli04 : Killed 15 SELECT   cv_posts.*
 FROM cv_posts  WHERE 1=1  AND post_name = 'wp-cronphp' AND (post_type =
 'post')  |
 mar jan 30 11:22:47 CET 2007 : sainteli04 : Killed 15 SELECT option_name,
 option_value FROM cv_options WHERE autoload =
 'yes'                              |
 mar jan 30 11:22:50 CET 2007 : sainteli04 : Killed 17 SELECT   cv_posts.*
 FROM cv_posts  WHERE 1=1  AND post_name = 'wp-cronphp' AND (post_type =
 'post')  |
 mar jan 30 11:22:50 CET 2007 : sainteli04 : Killed 17 SELECT   cv_posts.*
 FROM cv_posts  WHERE 1=1  AND post_name = 'wp-cronphp' AND (post_type =
 'post')  |
 mar jan 30 11:22:50 CET 2007 : sainteli04 : Killed 17 SELECT   cv_posts.*
 FROM cv_posts  WHERE 1=1  AND post_name = 'wp-cronphp' AND (post_type =
 'post')  |
 mar jan 30 11:22:50 CET 2007 : sainteli04 : Killed 17 SELECT option_name,
 option_value FROM cv_options WHERE autoload =
 'yes'                              |
 }}}

-- 
Ticket URL: <http://trac.wordpress.org/ticket/3713#comment:7>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list