Hello Roy,

How is the RAM usage over the duration of the upload?

On 14 January 2015 18:19:52 CET, Roy Russo <[email protected]> wrote:
>Hello all,
>
>I've been testing a simple REST endpoint that handles form PUT/POST
>file 
>uploads with varying file sizes. It appears there exists a limit at or
>near 
>2GB file sizes that doesn't allow a file larger than 2GB to be
>uploaded. 
>Once the upload begins, via a cURL call, the system seems to hang for 
>several minutes and then dies...
>
>The endpoint code is fairly simple:
>
> @staticmethod 
>    def put(): 
>        file = request.files['file'] 
> 
>        try: 
>            source_extension = os.path.splitext(file.filename)[1] 
>            destination_filename = uuid4().hex + source_extension 
>         file.save(os.path.join(CONFIG.TMP_DIR, destination_filename)) 
>        except: 
>            msg = 'Unable to process file upload' 
>            LOG.exception(msg) 
>return APIError(client.INTERNAL_SERVER_ERROR, False, msg).make_error() 
> 
>        return RESTResponse([], client.OK, None) 
>
>
>
>
>
>
>
>
>
>
>
>
>
>Traceback (most recent call last):
>
>File "/usr/local/lib/python3.4/site-packages/flask/app.py", line 1836,
>in 
>__call__
>
>    return self.wsgi_app(environ, start_response)
>
>File "/usr/local/lib/python3.4/site-packages/flask/app.py", line 1820,
>in 
>wsgi_app
>
>    response = self.make_response(self.handle_exception(e))
>
>File "/usr/local/lib/python3.4/site-packages/flask_cors.py", line 272,
>in 
>wrapped_function
>
>    return cors_after_request(app.make_response(f(*args, **kwargs)))
>
>File
>"/usr/local/lib/python3.4/site-packages/flask_restful/__init__.py", 
>line 261, in error_router
>
>    return self.handle_error(e)
>
>File "/usr/local/lib/python3.4/site-packages/flask/app.py", line 1817,
>in 
>wsgi_app
>
>    response = self.full_dispatch_request()
>
>File "/usr/local/lib/python3.4/site-packages/flask/app.py", line 1477,
>in 
>full_dispatch_request
>
>    rv = self.handle_user_exception(e)
>
>File "/usr/local/lib/python3.4/site-packages/flask_cors.py", line 272,
>in 
>wrapped_function
>
>    return cors_after_request(app.make_response(f(*args, **kwargs)))
>
>File
>"/usr/local/lib/python3.4/site-packages/flask_restful/__init__.py", 
>line 261, in error_router
>
>    return self.handle_error(e)
>
>File "/usr/local/lib/python3.4/site-packages/flask/app.py", line 1475,
>in 
>full_dispatch_request
>
>    rv = self.dispatch_request()
>
>File "/usr/local/lib/python3.4/site-packages/flask/app.py", line 1461,
>in 
>dispatch_request
>
>    return self.view_functions[rule.endpoint](**req.view_args)
>
>File
>"/usr/local/lib/python3.4/site-packages/flask_restful/__init__.py", 
>line 430, in wrapper
>
>    resp = resource(*args, **kwargs)
>
>File "/usr/local/lib/python3.4/site-packages/flask/views.py", line 84,
>in 
>view
>
>    return self.dispatch_request(*args, **kwargs)
>
>File
>"/usr/local/lib/python3.4/site-packages/flask_restful/__init__.py", 
>line 520, in dispatch_request
>
>    resp = meth(*args, **kwargs)
>
>File
>"/Users/royrusso/dev/predikto/predikto-rest/predikto/api/upload.py", 
>line 17, in put
>
>    file = request.files['file']
>
>File "/usr/local/lib/python3.4/site-packages/werkzeug/local.py", line
>338, 
>in __getattr__
>
>    return getattr(self._get_current_object(), name)
>
>File "/usr/local/lib/python3.4/site-packages/werkzeug/utils.py", line
>71, 
>in __get__
>
>    value = self.func(obj)
>
>File "/usr/local/lib/python3.4/site-packages/werkzeug/wrappers.py",
>line 
>512, in files
>
>    self._load_form_data()
>
>File "/usr/local/lib/python3.4/site-packages/flask/wrappers.py", line
>165, 
>in _load_form_data
>
>    RequestBase._load_form_data(self)
>
>File "/usr/local/lib/python3.4/site-packages/werkzeug/wrappers.py",
>line 
>356, in _load_form_data
>
>    mimetype, content_length, options)
>
> File "/usr/local/lib/python3.4/site-packages/werkzeug/formparser.py", 
>line 193, in parse
>
>    content_length, options)
>
> File "/usr/local/lib/python3.4/site-packages/werkzeug/formparser.py", 
>line 99, in wrapper
>
>    return f(self, stream, *args, **kwargs)
>
> File "/usr/local/lib/python3.4/site-packages/werkzeug/formparser.py", 
>line 210, in _parse_multipart
>
>    form, files = parser.parse(stream, boundary, content_length)
>
> File "/usr/local/lib/python3.4/site-packages/werkzeug/formparser.py", 
>line 520, in parse
>
>    return self.cls(form), self.cls(files)
>
>File
>"/usr/local/lib/python3.4/site-packages/werkzeug/datastructures.py", 
>line 373, in __init__
>
>    for key, value in mapping or ():
>
> File "/usr/local/lib/python3.4/site-packages/werkzeug/formparser.py", 
>line 518, in <genexpr>
>
>    form = (p[1] for p in formstream if p[0] == 'form')
>
> File "/usr/local/lib/python3.4/site-packages/werkzeug/formparser.py", 
>line 494, in parse_parts
>
>    _write(ell)
>
>OSError: [Errno 22] Invalid argument
>
>Thoughts?

-- 
You received this message because you are subscribed to the Google Groups 
"pocoo-libs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pocoo-libs.
For more options, visit https://groups.google.com/d/optout.

Reply via email to