Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Liip + KnpGaufrette + Google Cloud Service : slow performances #1288

Closed
ludovicpages opened this issue Jun 11, 2020 · 5 comments
Closed

Liip + KnpGaufrette + Google Cloud Service : slow performances #1288

ludovicpages opened this issue Jun 11, 2020 · 5 comments

Comments

@ludovicpages
Copy link

ludovicpages commented Jun 11, 2020

Hello.
I'm successfully using Google Cloud Service with Liip and Kip Gaufrette.
Doing a {{image.jpg|imagine_filter( 'my_filter' )}} generates the filtered image on a cache folder on the GCS bucket. Works fine.

The problem I'm facing, is that even when the filtered images exists on the cache folder on the GCS bucket, it takes a long time for the image to be displayed. I kind of understand why, back and force between my server and GCS ( checking if object exists, then returning the objet from who i can build the object Url.

If I'm calling the URL directly, it's fast and furious.

Maybe I'm missing something, am I suppose to add a layer on top of that config ?
And storing the urls in a cache locally ?

I think I'm missing something here :)

Thanks.

@przemyslawkliktu
Copy link

Hi,

could you share your config?

@Warxcell
Copy link
Contributor

@oliver-schulz
Copy link

The problem here is when you want to return a url or a resolve url to your frontend the bundle checks first if the image in the given filter configuration is already created, if not the filter generates one cached image. The problem here that you have to ask every time the google api if there is a cached images and the response times from google api are "slow". So if you have to render several images, eg. product list, the server time gets even longer, in our case we had to render about 52 images and every api call needed about 30ms for each images, so we "waited" 1.5 seconds for asking google if there is a cached image :)

We "solved" it by using a redis cache which stores all the generated images for us, so we don't have to ask google first.

@peter-gribanov
Copy link
Contributor

The problem can be solved by warming up the cache and always using a link to the cache in the templates without hecking for availability #1348

@ludovicpages
Copy link
Author

Thanks guys.
Same as @oliver-schulz we hacked it by storing the images with filter on Memcached.

@dbu dbu closed this as completed Oct 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants