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

Potential optimizations #8

Closed
wshayes opened this issue May 21, 2019 · 7 comments
Closed

Potential optimizations #8

wshayes opened this issue May 21, 2019 · 7 comments

Comments

@wshayes
Copy link
Contributor

wshayes commented May 21, 2019

Was reading these recommendations https://pythonspeed.com/articles/gunicorn-in-docker/ and noticed that they were not integrated in the relevant Dockerfiles as defaults.

  • heartbeat file in /dev/shm --> --worker-tmp-dir /dev/shm
  • Logging -> --log-files=-
@tiangolo
Copy link
Owner

Interesting!

So, the --log-files refers to this setting: http://docs.gunicorn.org/en/stable/settings.html#errorlog, which is set here: https://github.com/tiangolo/uvicorn-gunicorn-docker/blob/master/python3.6/gunicorn_conf.py#L30 ✔️

The --worker-tmp-dir refers to this: http://docs.gunicorn.org/en/stable/settings.html#worker-tmp-dir, it would be a line with worker_tmp_dir = "/dev/shm", probably under the previous line. ❔

Would you like to add a PR with that?

@wshayes
Copy link
Contributor Author

wshayes commented May 22, 2019

Sorry missed the log-files config. Just added the PR for the heartbeat file. Thanks!

@tiangolo
Copy link
Owner

Thanks for your help @wshayes ! It's merged now, so I'll close this issue. But feel free to add more comments, new issues, etc.

@NixBiks
Copy link

NixBiks commented Mar 17, 2020

Any reason this was only implemented in python3.6 image and not the other images?

@tiangolo
Copy link
Owner

@mr-bjerre hmm, not sure what you refer to. 🤔

This is implemented in all the images, the links for Python 3.6 above are just an example of the location where it is located.

@NixBiks
Copy link

NixBiks commented Apr 14, 2020

Are you sure? Looking at python 3.7 image it doesn't look like it to me!?

https://github.com/tiangolo/uvicorn-gunicorn-docker/blob/master/python3.7/gunicorn_conf.py

@tiangolo
Copy link
Owner

tiangolo commented Jun 4, 2020

@mr-bjerre I think you were right, I recently made a big refactor to make all the images share the same config and avoid the chance of having desynchronizations like that for each image 😅

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