Skip to content
This repository has been archived by the owner on Mar 5, 2020. It is now read-only.

MemoryError on large uploads #33

Open
scardine opened this issue Oct 16, 2017 · 1 comment
Open

MemoryError on large uploads #33

scardine opened this issue Oct 16, 2017 · 1 comment

Comments

@scardine
Copy link

scardine commented Oct 16, 2017

Looks like Daphne will choke on large POST requests (in my case while uploading a large file).

out 16 16:48:12 icr daphne[29020]: 2017-10-16 16:48:12,424 ERROR    Traceback (most recent call last):
out 16 16:48:12 icr daphne[29020]:   File "/var/app/virtualenvs/ev/lib/python3.6/site-packages/daphne/http_protocol.py", line 174, in process
out 16 16:48:12 icr daphne[29020]:     "server": self.server_addr,
out 16 16:48:12 icr daphne[29020]:   File "/var/app/virtualenvs/ev/lib/python3.6/site-packages/asgi_ipc/core.py", line 68, in send
out 16 16:48:12 icr daphne[29020]:     time.time() + self.expiry,
out 16 16:48:12 icr daphne[29020]:   File "/var/app/virtualenvs/ev/lib/python3.6/site-packages/asgi_ipc/store.py", line 116, in append
out 16 16:48:12 icr daphne[29020]:     value.setdefault(name, []).append((item, expiry))
out 16 16:48:12 icr daphne[29020]:   File "/usr/lib/python3.6/contextlib.py", line 89, in __exit__
out 16 16:48:12 icr daphne[29020]:     next(self.gen)
out 16 16:48:12 icr daphne[29020]:   File "/var/app/virtualenvs/ev/lib/python3.6/site-packages/asgi_ipc/store.py", line 64, in mutate_value
out 16 16:48:12 icr daphne[29020]:     pickle.dump(value, self.mmap, protocol=2)
out 16 16:48:12 icr daphne[29020]: MemoryError

I'm using Python 3.6.1 (64bit) on Ubuntu 17.04 with 8G RAM. Uploaded file is 1.6GB.

Looks like a problem with pickle, is there any way to use other pickle-compatible serializer that is better for larger objects?

@andrewgodwin
Copy link
Member

Yup, seems likely, we still didn't get proper large file streaming in yet. I'd recommend using a WSGI server for large uploads for now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants