> Hello > > I have been trying to monitor stats in our uWSGI instance. Our config -- > without the stats stuff -- looks like this: > >>> > env UWSGI_VASSAL_MODULE=wsgi_app > env UWSGI_VASSAL_CHMOD=666 > env UWSGI_VASSAL_DISABLE-LOGGING=true > setuid www-data > setgid www-data > exec /usr/local/bin/uwsgi --log-syslog emperor --emperor > /etc/uwsgi/vassals > --emperor-broodlord 10 > << > >>> > [uwsgi] > log-syslog=uwsgi-keepcalm > socket=:3031 > pythonpath=/var/www-hosts/keepcalm > processes=4 > zerg-server=/var/www-hosts/keepcalm/restricted/broodlord.sock > vassal-sos-backlog=5 > > [zerg] > log-syslog=uwsgi-keepcalm-zerg > zerg=/var/www-hosts/keepcalm/restricted/broodlord.sock > pythonpath=/var/www-hosts/keepcalm > << > > This means we have an emperor process, then a [uwsgi] master with four > workers underneath it. Under load, zerg masters will spawn, each with a > single worker underneath them. > > http://uwsgi-docs.readthedocs.org/en/latest/Options.html#emperor-stats-emperor-stats-server > > So, first off I tried `-emperor-stats` on :1717 in the main config. That > was kinda useless, because all it told me was that there was there was a > single Emperor doing very little. I expected it would return stats on all > of the children underneath the emperor, but it doesn't. > > http://uwsgi-docs.readthedocs.org/en/latest/StatsServer.html > > So I then I tried `stats=:1717` in the [uwsgi] section. That conflicted > with the emperor's use of the port, so I stopped the emperor from serving > stats. That was great, it told me what the four normal workers were doing > -- but it didn't give me the zerg stats. Of course, if I tell the zergs to > use :1717 they conflict with each other, the normal [uwsgi] workers and > the > Emperor. >
Each instance (standard, or zerg), has to bind to a different address. Using unix socket is a good trick, and you can dinamically generate their name for each vassal using magic vars: [uwsgi] ... stats = %n.stats.socket [zerg] ... stats = %s-zerg.stats.socket The problem arises if you have multiple zerg instances running. The only solution i can think of, is adding another magic var exporting the zerg instance number in the config (%z ?) -- Roberto De Ioris http://unbit.it _______________________________________________ uWSGI mailing list [email protected] http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
