S3-Uploads icon indicating copy to clipboard operation
S3-Uploads copied to clipboard

Large amount of redundant traffic

Open pc-erin opened this issue 3 years ago • 1 comments

On one of our sites that uses s3-uploads I noticed that the bucket showed a large amount of excess egress traffic.

It seems that the image is being uploaded, then downloaded repeatedly, once for each image processing task.

I think it's mostly happening with side-loaded images. My suspicion is based on there being a bunch of files that show up and then deleted in the uploads/tmp/ dir in the bucket. I also found a function called filter_sideload_move_temp_file_to_s3 that appears to be intentionally moving side-loaded images to the bucket for processing.

The comment on filter_sideload_move_temp_file_to_s3 references the wordpress ticket https://core.trac.wordpress.org/ticket/29257 The ticket page shows as fixed now. Do we still need to move the image and do processing on the bucket, or is there a way to do it more efficiently?

pc-erin avatar Feb 10 '22 22:02 pc-erin

It seems like it'd be easier to do the image processing in /tmp. I'm going to see if there's a way to add filters or something that will move processing over there, then just copy the files into the uploads dir when done. Might take a bit to get to it though so if anyone else has a solution in the meantime feel free to post it.

pc-erin avatar Apr 21 '22 16:04 pc-erin