Opened 16 years ago
Closed 16 years ago
#11071 closed defect (bug) (worksforme)
exclude_tree in wp_list_pages causes heavy CPU usage
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 2.8.4 |
| Component: | Cache API | Keywords: | reporter-feedback |
| Focuses: | Cc: |
Description
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)
Note: See
TracTickets for help on using
tickets.
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.