[wp-trac] [WordPress Trac] #40441: High server resource usage and timeouts during image uploads
WordPress Trac
noreply at wordpress.org
Thu Apr 13 23:27:11 UTC 2017
#40441: High server resource usage and timeouts during image uploads
-------------------------+------------------------------
Reporter: enshrined | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Media | Version:
Severity: normal | Resolution:
Keywords: | Focuses:
-------------------------+------------------------------
Comment (by enshrined):
@blobfolio I'm not sure I'd agree with using a pseudo-source as this would
either have to be user definable, which goes against "Decisions, not
Options" or large enough to accommodate all uses. For example, I worked on
a site recently that have needed to background images to look sharp on
smart TVs etc and as such images up to 6000px were loaded onto the site by
the client. A edge case, I understand but still, there will be people who
want those larger images and if all resizing is done from a 2000px image
this stops that.
I may be wrong, but I'm also fairly certain that the `WP_Image_Editor_*`
classes only load the original image resource once which is then stored
within `protected $image`. If intermediate image size creation is called
correctly, using the `multi_resize` method then it should just resize
using this pre-loaded image resource which then gets destroyed in the
`__destruct` method.
Personally, I think a good way to go would be to decouple intermediate
image size creation from the upload process completely. As long as it's
tied to the upload there will always be issues when themes and plugins add
significant numbers of image sizes, as there's only so much optimisation
that can be done here.
I'd love to see a background queueing system used to enable us to
accomplish this, a good start is the one at https://github.com/A5hleyRich
/wp-background-processing. Using this method original images could be
uploaded and stored and the intermediate sizes queued to be created, as
each completes it can then update the attachment meta with the appropriate
data.
I created a plugin to play around with this concept before which is
available at https://github.com/darylldoyle/WP-Background-Image-Processing
if anyone is interested in taking a look.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/40441#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list