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

Performance issue with hundreds of thumbs on S3 #253

Closed
gonzalovilaseca opened this issue Oct 14, 2013 · 2 comments
Closed

Performance issue with hundreds of thumbs on S3 #253

gonzalovilaseca opened this issue Oct 14, 2013 · 2 comments
Labels
Attn: Critical This issue or PR is critical and should be rushed into a new release ASAP. State: Rejected This item has been rejected as being invalid or otherwise not desired by maintainers.

Comments

@gonzalovilaseca
Copy link

I have a problem with performance when requesting around 300 thumbnails (images are stored in S3, and I'm using the s3 cache resolver):

Images are uploaded via an API, on upload I generate the necessary thumbnails with LiipImagine.

Images are then displayed in an album with this filter:
photo_path | imagine_filter('thumb_200x200')

It takes a few minutes to display the page even though thumbnails are already created.

OTOH I have an API call that returns all the thumbnails of the album:
$imagemanagerResponse = $this->container
->get('liip_imagine.controller')
->filterAction(
$this->getRequest(),
$myPhoto->getName(), // original image you want to apply a filter to
'thumb_200x200' // filter defined in config.yml
);

    $cacheManager = $this->container->get('liip_imagine.cache.manager');
    $srcPath = $cacheManager->getBrowserPath($myPhoto->getName(), 'thumb_200x200');

    return $srcPath;

This api call takes about a minute too.

I have tested modifying getBrowserPath so that it doesn't check for $objectPath but performance is still very poor.

I guess the only way of really speeding it up would be to save each thumbnail path on the DDBB, and then just get this field on my src attribute. Is that correct?

@havvg
Copy link
Contributor

havvg commented Oct 22, 2013

Please take a look at #184.

@gonzalovilaseca
Copy link
Author

It was the getBrowserPath of the s3 resolver that was very slow, so I just created my own resolver with this function:
public function getBrowserPath($path, $filter, $absolute = false)
{
$objectPath = $this->getObjectPath($path, $filter);

        return $this->getObjectUrl($objectPath);

}

It's way faster, but thumbnails have to be generated before twig renders them.

@havvg havvg closed this as completed Nov 11, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Attn: Critical This issue or PR is critical and should be rushed into a new release ASAP. State: Rejected This item has been rejected as being invalid or otherwise not desired by maintainers.
Projects
None yet
Development

No branches or pull requests

2 participants