[wp-trac] [WordPress Trac] #11071: exclude_tree in wp_list_pages causes heavy CPU usage

WordPress Trac wp-trac at lists.automattic.com
Wed Nov 4 06:00:53 UTC 2009


#11071: exclude_tree in wp_list_pages causes heavy CPU usage
--------------------------+-------------------------------------------------
 Reporter:  henry.jiang   |       Owner:  ryan      
     Type:  defect (bug)  |      Status:  new       
 Priority:  normal        |   Milestone:  Unassigned
Component:  Cache         |     Version:  2.8.4     
 Severity:  normal        |    Keywords:            
--------------------------+-------------------------------------------------
 When using exclude_tree in wp_list_pages to exclude pages from the page
 menu bar, CPU usage jumps to 99.9%. In my example, I have 3000 pages who's
 parent is 13955 that I'm excluding from the menu bar by using exclude_tree
 in wp_list_pages.

 This caused 99.9% CPU usage, and in a high traffic scenario, web server
 crashed unexpectedly. The piece of code responsible is in wp-
 include\post.php: &get_posts()

 exclude_tree is being done after get_results() and update_page_cache().
 This is the reason for the CPU spike.

 A better way to implement exclude_tree should be before the call to
 get_results()

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/11071>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list