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

Massively increased load times

Open KarolisAntanas opened this issue 2 years ago • 2 comments

Hi!

Great plugin but I'm having an issue with performance. Read similar issues like mine, none of them gave me the needed answer. In most of them it's assumed that there's a conflict with another plugin or theme. Tried to debug it, disable all the plugins except essential ones, switched to default WP theme, sadly it didn't help.

I've created two copies of the website with minimal functionality to show the problem. There's a mobile app which is getting data from the website so the main target is REST API endpoints. Both of these copies are in the same server and the setup is also identical except for the plugin in question.

Several examples:

http://s3-disabled.invsbl.lt/wp-json/app/v2/pois 4-5s load time https://s3.invsbl.lt/wp-json/app/v2/pois 22-26s load time

http://s3-disabled.invsbl.lt/wp-json/app/v2/routes 1-2s load time https://s3.invsbl.lt/wp-json/app/v2/routes 4-5s load time

There are 3 plugins enabled in s3 version: https://nimb.ws/WBon7l

ACF, S3 and our custom plugin which inits CPTs, creates endpoints and uses ACF functions to expose data. No optimisations, anything with file directories, just common ACF functions.

This plugin is working great apart from performance problem so it would be awesome to find the problem but I'm unable to do that. Do you have any idea what might be wrong?

Thanks a lot.

Similar issues:

https://github.com/humanmade/S3-Uploads/issues/148 https://github.com/humanmade/S3-Uploads/issues/520 https://github.com/humanmade/S3-Uploads/issues/466 https://github.com/humanmade/S3-Uploads/issues/395 https://github.com/humanmade/S3-Uploads/issues/350 https://github.com/humanmade/S3-Uploads/issues/431

KarolisAntanas avatar Jul 28 '22 13:07 KarolisAntanas

Are you reading/writing data from/to uploads? Reading objects will have a round-trip time penalty which could easily lead to this sort of behaviour (which would also happen with eg NFS storage).

Or, is this even with no filesystem calls, and purely from the connection cost?

rmccue avatar Jul 28 '22 14:07 rmccue

@rmccue

No writing data to uploads is happening.

To get img URLs we're using ACF get_field() function which returns image data array. I believe this functions returns image metadata which is saved in DB on image upload, so there shouldn't be any interactions with uploads directly.

Another thing is that the example with S3 disabled has upload directory URL rewritten to production site's URL because I didn't want to migrate 15GB of uploads: https://nimb.ws/k75iqJ But this does not cause load time increase while S3 rewrites do.

KarolisAntanas avatar Jul 29 '22 11:07 KarolisAntanas