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

How can I enable threads? #71

Closed
flyrev opened this issue Jul 12, 2018 · 4 comments
Closed

How can I enable threads? #71

flyrev opened this issue Jul 12, 2018 · 4 comments

Comments

@flyrev
Copy link

flyrev commented Jul 12, 2018

The following line is output on start:

*** Python threads support is disabled. You can enable it with --enable-threads ***

How can I do that using the tiangolo/uwsgi-nginx-flask:python3.6 image?

@flyrev
Copy link
Author

flyrev commented Jul 12, 2018

Overwriting ENTRYPOINT with something like

ENTRYPOINT ["uwsgi", "--http", "0.0.0.0:80", "--module", "main:app", "--processes", "8", "--threads", "8"] seems to have done the trick (#29 (comment))

But I'm open to other suggestions/recommendations.

@flyrev flyrev closed this as completed Jul 13, 2018
@jhelion
Copy link

jhelion commented Nov 30, 2018

looks like this is closed but I just encountered this issue (11.29.18). I added:
enable-threads = true
to uwsgi.ini and was able to run threads in my container. Hope that helps someone.
edit: for google: nginx docker flask thread threading tiangolo
also, thanks tiangolo, great build

@tiangolo
Copy link
Owner

tiangolo commented Jan 1, 2019

Sorry for the delay! I was busy building FastAPI.

As this seems to be a popular request, I added a section about it in the docs. With the same technique @jhelion is using.

https://github.com/tiangolo/uwsgi-nginx-flask-docker#custom-uwsgiini-configurations

You can add a file to /app/uwsgi.ini with:

[uwsgi]
module = main
callable = app
enable-threads = true

also, thanks tiangolo, great build

I'm glad to hear that! 😄 🎉

ilyaukin pushed a commit to ilyaukin/sadist-be that referenced this issue Mar 9, 2021
@MariamQusai
Copy link

the above was not enough for me. I also had to add lazy-apps=true

Thanks to this thread

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

4 participants