-
Notifications
You must be signed in to change notification settings - Fork 111
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
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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)The text was updated successfully, but these errors were encountered: