WordPress.org

Make WordPress Core

Opened 3 years ago

Last modified 2 years ago

#17382 new defect (bug)

XMLRPC wp_getUsersBlogs Scalability

Reported by: bmorneau Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 3.0.1
Component: XML-RPC Keywords: needs-patch
Focuses: Cc:

Description

If there is a root blog with many sub blogs on it and a user that is an admin on each sub blog, then when the when the XML RPC method wp_getUsersBlogs() is called it does not scale very well. My PHP memory_limit setting was 128MB, and the XML RPC request died when a user was a member of 230+ blogs. I noticed that the number of queries made to the database for a single user that has many blogs that they are an admin is very high.

Affected line: http://core.trac.wordpress.org/browser/tags/3.0.1/xmlrpc.php#L443

I don't know exactly how the code would have to change so I am not providing a patch.

Change History (4)

comment:1 follow-up: josephscott3 years ago

  • Cc josephscott added

I think this is a bit of an edge case, I don't expect to see too many people with more than 200 user accounts on a single WP install. The only short term fix is to increase your allowed memory setting to deal with processing that much data.

Long term, we'd probably need some sort of paging ability so that you can request the list in chunks.

comment:2 in reply to: ↑ 1 ; follow-up: ericmann3 years ago

Replying to josephscott:

Long term, we'd probably need some sort of paging ability so that you can request the list in chunks.

+1 for paging the response. We would probably want to set it to return only the first 50 blogs or so by default for performance, but you could override that with any number or just make multiple requests for multiple pages of results.

comment:3 in reply to: ↑ 2 bmorneau3 years ago

Replying to ericmann:

Replying to josephscott:

Long term, we'd probably need some sort of paging ability so that you can request the list in chunks.

+1 for paging the response. We would probably want to set it to return only the first 50 blogs or so by default for performance, but you could override that with any number or just make multiple requests for multiple pages of results.

With the platform I work on there are approximately 350+ blogs on a single network and a few users who are Super Admins in addition to having admin roles on each blog. We have other networks as well that have an increasing number of blogs and users with Super Admin/Admin privileges. Paging would definitely be a more optimal solution to this.

comment:4 mohanjith2 years ago

Patch for #20665 should fix the out of memory issue

+1 for pagination in the long run

Note: See TracTickets for help on using tickets.