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

This plugin is not using the tornado runloop and thus is very slow! #21

Open
RobertBiehl opened this issue Mar 26, 2015 · 11 comments
Open

Comments

@RobertBiehl
Copy link

UPDATE
Ah, I missed the pull request in async S3 HTTP with botornado #14
Please merge! :)

ORIGINAL POST
When comparing the loader and storage classes in this plugin with the standard http loader for example (https://github.com/thumbor/thumbor/blob/master/thumbor/loaders/http_loader.py) then you'll see that thumbor_aws is blocking the whole runloop when fetching files from s3.
This is a bad practice when working with tornado and defeats the purpose of thumbor, which usually is very fast.
A possible solution would be to use tornado-botocore (https://github.com/nanvel/tornado-botocore) instead, which allows htto requests through the standard tornado.httpclient.

E.g. compare https://github.com/thumbor/thumbor/blob/master/thumbor/loaders/http_loader.py#L87
client.fetch(req, callback=partial(return_contents, url=url, callback=callback, context=context)) (proper callback usage)
with https://github.com/willtrking/thumbor_aws/blob/master/thumbor_aws/loaders/s3_loader.py#L58
return callback(file_key.read()) (blocks the runloop)

@vvh-empora
Copy link

+1

7 similar comments
@Luisehahne
Copy link

+1

@cmuskalla
Copy link

+1

@burnerx
Copy link

burnerx commented Mar 26, 2015

+1

@janlem
Copy link

janlem commented Mar 26, 2015

+1

@DarkViper
Copy link

+1

@SebastianBoldt
Copy link

+1

@ndc-empora
Copy link

+1

@RobertBiehl
Copy link
Author

Ah, I missed the pull request in async S3 HTTP with botornado #14
Please merge! :)

@BaconFist
Copy link

+1

@aectann
Copy link

aectann commented May 19, 2015

Doesn't seem to be a problem anymore since Thumbor 5.0 got released. Need to fix the code to support 5.0 though. Here is a PR for that: #24

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