3 ms·
The configuration method for the Gunicorn server (http://docs.gunicorn.org/en/stable/configure.html#configuration-file http://docs.gunicorn.org/en/stable/config
by gomoboo 8y ago
The configuration method for the Gunicorn server (http://docs.gunicorn.org/en/stable/configure.html#configuration-file http://docs.gunicorn.org/en/stable/configure.html#configurat...) would be a great example to follow. Configuration files are just Python modules. You can specify the number of workers and set log file locations with the following:
from multiprocessing import cpu_count
def max_workers():
return cpu_count() * 2 + 1
workers = max_workers()
errorlog = "/var/www/lcfs/logs/error_logs.log"
accesslog = "/var/www/lcfs/logs/access_logs.log"
- taeric 8y agoYou should see how people configure their emacs setups. :D
- d0mine 8y agouse-package is a nice declarative way to configure packages in .emacs
- taeric 8y agoAnd it is just a standard macro. Nothing built into emacs to support it. My point being that just having some code to configure your thing is not exactly novel. Just not commonly done. Outside of lisp communities.
- js2 8y agoGunicorn probably got this idea from Django, which probably got the idea from Lisp (see also, emacs). :-)
- tracker1 8y agoHow would one integrate that with a (Rust|go|C#|thoer-compiled-language) application on Windows? Yeah, you can do stuff like that in a scripted language. Doesn't make it a good option even in the majority of cases.