-
-
Notifications
You must be signed in to change notification settings - Fork 498
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
Serious performance issues in 12.2 (AWS S3) #351
Comments
It's so broken. I had to revert to |
This is directly related on the storage implementation, exists is needed to make sure we overwrite the thumbnail file. We have a possible solutions, Add a THUMBNAIL_FORCE_OVERWRITE, by default set to False, where if set to true it will look for only regenerate a thumbnail if one with the same name doesn't already exist in storage. Especially we can not fix a bad storage implementation, where .exists() is slow, this feature was added because to avoid hit the storage for every thumbnail creation, is fast for some storage implementations and slow to another cc: @relekang |
@camilonova A quote from the #92 about this issue from
would you still want to provide a solution in the sorl-thumbnail code base, or solve it on your storage implementation? |
@mariocesar I'm sure we can set to override the thumbnail if does not exist in cache, only when we are using S3. If you agree is a good idea, let me know where and I'll work on a PR. |
I already start this https://github.com/mariocesar/sorl-thumbnail/tree/features/force_overwrite, please test it an look how can be improved. Will be great to have tests for this Here is the commit that introduces the new setting eb569ad |
Looks nice, the best default value for the new setting will be True if is using S3, that will make it easier for people who don't read the manual. |
Also will be nice to have a test were we can make sure (for future changes) this will be the behavior from now on. |
@mariocesar ping |
Is a fix for this planned to be released anytime soon? |
There is already |
Hi @mariocesar I see the the README mentions |
@bartels you are right, give me some time I will dig into this |
Ping, just curious what status is for this issue? |
I've created a pull request to reintroduce the THUMBNAIL_FORCE_OVERWRITE commit, since it seems to have unintentionally vanished from the repo. |
Thanks @haakenlid ! |
What if instead of using storage.exists() you used storage.open() and catched errors if not found? |
It is slow latest boto 2 and sorl. It makes a lot of exists even THUMBNAIL_FORCE_OVERWRITE is true. |
I see that |
Hi, I use version 12.9.0 with S3 and THUMBNAIL_FORCE_OVERWRITE=True and performance is terrible. It takes minutes to load a page. How can I debug the problem? I do not understand what is taking so long. |
Hello,
There is a serious performance issue in current 12.2 branch. Problem is that we have ~2M thumbnails, so if execution goes here (marked line):
it is actually asks boto to return LIST of all stored thumbnails (without even using prefix), so appliction hangs with 100% CPU and high memory usage (well, not a surprise actually).
Wouldn't it be better to provide a prefix for lookup (constructed with the same function as used to store thumbnail) ?
In a mean time we've had to revert to 11.12.1b which works better.
This is related to a fix introduced in #92
The text was updated successfully, but these errors were encountered: