Opened 9 years ago
Closed 9 years ago
#36815 closed defect (bug) (duplicate)
(intermittently) Unable to upload media on very large network sites as a super admin.
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.4.2 |
Component: | Media | Keywords: | |
Focuses: | administration, multisite, performance | Cc: |
Description
Environment:
- Large multisite installs (a couple thousand sites or more)
- memcached
- niginx
- php-fpm
- php5.5
- Specific versions aren't related to the root cause of this bug.
When uploading a file, 'admin_init' action is called, which eventually calls _wp_admin_bar_init()
in wp-includes/admin-bar.php which calls get_blogs_of_user()
in wp-includes/user.php which calls get_blog_details()
for every blog the user has capabilities on. This results in long upload times for small files and in some cases causes the upload to fail as memcached has a throttle once a connection has surpassed a specific number of requests in a short time.
Ideally, WordPress would cache the result of this expensive lookup and check the cache before querying the database or memcached so that uploading multiple files at one time doesn't cause an upload to fail or put strain on resources unnecessarily.
Hi @withinboredom, thanks for the ticket.
I'm going to close this out as a duplicate of #31746 as the underlying reason appears to be the same. Please leave a comment on that ticket as well.
See also #36707, in which the
pre_get_blogs_of_user
filter has been added for 4.6 and will allow you to short circuit the entire process.