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

Document uWSGI requirements #235

Open
dstufft opened this issue Sep 9, 2015 · 2 comments
Open

Document uWSGI requirements #235

dstufft opened this issue Sep 9, 2015 · 2 comments

Comments

@dstufft
Copy link
Contributor

dstufft commented Sep 9, 2015

Just adding this here as a note since I think it should be documented and I don't want to have it get lost.

Essentially, if you try to use uWSGI + pyramid_debugtoolbar it's going to fail by default with a KeyError: PATH_INFO. This is because, by default, uWSGI attempts to reduce the number of mallocs it takes to serve a request and it will instead preallocate a Python dictionary, then for each request it will populate that dictionary, call the WSGI callable, and then afterwords it will clear that dictionary. However, things like pyramid_debugtoolbar expect to be able to keep a reference to the environ dictionary and use that after the request has finished. Once you know the issue is a issue, fixing it is pretty trivial, uWSGI allows you to configure this behavior and go to a more typical "allocate a dictionary per request, let the GC handle cleaning it up" behavior using the --wsgi-env-behavior holy configuration option.

@stevepiercy
Copy link
Member

Suggest a sub-section under Setup, maybe "Setup with uWSGI servers"?

@habnabit
Copy link

habnabit commented Sep 3, 2019

wow! that exactly explains the weird behavior I was having. maybe debugtoolbar could copy those lists itself anyway?

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

3 participants