wsgi daemon mode
See original GitHub issueI run my stateless flask apps with mod_wsgi/apache using daemon mode like:
WSGIDaemonProcess foo-services python-home=/opt/my_org/foo-services/_env processes=8 threads=48 maximum-requests=10000 display-name=%{GROUP}
WSGIApplicationGroup %{GLOBAL}
WSGISocketPrefix /var/run/wsgi
Alias /image-services "/opt/my_org/foo-services/wsgi.py"
<Location "/for-services">
SetHandler wsgi-script
Options +ExecCGI
FileETag None
ExpiresActive On
ExpiresDefault "access plus 1 year"
WSGIProcessGroup image-services
</Location>
Which means when a request gets to the service it could be hitting 1 of 8 daemon processes each of which have their own memory in isolation of the others. Does the metrics endpoint store the prometheus data in a way that is shared across these daemons?
I can create some tests to verify if thats the case or not, just curious if the answer is already known.
Thanks, Thatcher
Issue Analytics
- State:
- Created 5 years ago
- Comments:30 (15 by maintainers)
Top Results From Across the Web
Quick Configuration Guide — mod_wsgi 4.9.4 documentation
In daemon mode a set of processes is created for hosting a WSGI application, with any requests for that WSGI application automatically being...
Read more >mod_wsgi daemon mode - WSGIDaemonProcess per virtual ...
When mod_wsgi is run in Daemon mode, and you enable the WSGIDaemonProcess and WSGIProcessGroup directives on a per virtual host basis, ...
Read more >Mod wsgi notes - Helpful
Daemon mode means mod_wsgi starts up and manages separate processes. creates a set of daemon processes (mount is configurable) which ...
Read more >How to use Django with Apache and mod_wsgi
“Daemon mode” is the recommended mode for running mod_wsgi (on non-Windows platforms). To create the required daemon process group and delegate the Django ......
Read more >mod_wsgi Configuration Directives - Google Code
Options ExecCGI SetHandler wsgi-script WSGIApplicationGroup %{ENV:APPLICATION_GROUP} ```. Note that in embedded mode or a multi process daemon process group ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Oh, so sorry I forgot to mention that! 😕 Yes, you do need that, maybe I should make that fail more aggressively, currently it’s only checked in a few places, and obviously your code path didn’t run into it. https://github.com/rycus86/prometheus_flask_exporter/blob/master/prometheus_flask_exporter/multiprocess.py#L12
Glad you managed to work it out! 👍
@rycus86 Thank you for your help, I will try this approach and return with results 😃 Yes, I will try to prepare such example. I want to reproduce that locally because I see this issue on Kubernetes pod only (