Make WordPress Core

Opened 9 years ago

Closed 8 years ago

#11071 closed defect (bug) (worksforme)

exclude_tree in wp_list_pages causes heavy CPU usage

Reported by: henry.jiang Owned by: ryan
Milestone: Priority: normal
Severity: normal Version: 2.8.4
Component: Cache API Keywords: reporter-feedback
Focuses: Cc:


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()

Change History (3)

#1 @scribu
9 years ago

  • Keywords reporter-feedback added

I think there have been some optimisations done in the upcoming WP 2.9 related to this.

Try updating to a nightly build and see if the problem persists.

#2 @scribu
8 years ago

  • Milestone Unassigned deleted

Closing for lack of reporter feedback.

#3 @scribu
8 years ago

  • Resolution set to worksforme
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.