#18781: FallbackStorage fails its purpose with uwsgi's default settings ------------------------------------------------+------------------------ Reporter: aaugustin | Owner: nobody Type: Cleanup/optimization | Status: new Component: contrib.messages | Version: master Severity: Normal | Keywords: Triage Stage: Unreviewed | Has patch: 0 Needs documentation: 0 | Needs tests: 0 Patch needs improvement: 0 | Easy pickings: 0 UI/UX: 0 | ------------------------------------------------+------------------------ `FallbackStorage` stores up to 3072 bytes of messages in cookies and the remainder in the session.
This is controlled by `CookieStorage.max_cookie_size = 3072`. Unfortunately: - other HTTP headers can take more than 1024 bytes, - uwsgi's default `buffer-size` is 4k, - all the HTTP headers must fit in one uwsgi buffer, otherwise uwsgi barfs. [http://projects.unbit.it/uwsgi/wiki/Doc uwsgi's doc] says: > If you plan to receive big requests with a lot of headers you can increase this value upto 64k `uwsgi` is a common WSGI app server. To reduce the likelihood of this problem, I suggest to reduce `CookieStorage.max_cookie_size` to `2048`. This is rather arbitrary, but it gives a bit more headroom. The main purpose of `FallbackStorage` is to store one or two messages in cookies, to avoid touching the session in possible. 2048 bytes is enough to store about 25 lines of text. -- Ticket URL: <https://code.djangoproject.com/ticket/18781> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.