Hi all.
After lot of words, comments and proposal i have finally committed a first
version of the uWSGI Emperor.
For the newcomers in the list, the uWSGI Emperor is a special uWSGI
instance that will manages other uWSGI instances. Its main purpose is the
massive hosting of different apps without the limits of multiple
interpreters or without headaches managing tons of different uWSGI
instances.
This is only a base for future development so feel free to spit out ideas
or improvements.
Well, lets see how it (currently) works.
To launch an emperor simply create a directory (it will holds all the
various instance configuration files) then:
uwsgi --emperor <dir>
uWSGI will start scanning <dir> searching for .xml/.ini/.yml/.yaml files.
Whenever it finds one it will spawn a new uWSGI instance.
Whenever you remove one of the files the corresponding instance will be
killed.
Whenever you touch/modify a file the corresponding instance will be reloaded.
Whenever a istance dies, it will be respawned.
You can imagine a Linux Distro that simply run at startup
/usr/bin/uwsgi --emperor /etc/uwsgi --pidfile /var/uwsgi/uwsgi.pid
--daemon /var/log/uwsgi.log
Than you can simply copy configuration files to /etc/uwsgi to start new apps.
The emperor and the single uWSGI instances are connected by a socketpair
and all the communications (stop, reload, kill) run over it (no unreliable
signals involved). So if you have idea of some kind of messages that can
be passed, please expose it.
Remember that if you run the emperor as root you can use different uid/gid
for every instance.
What about the webserver side ?
For now i have only tested it on nginx using a automagic configuration style:
location / {
uwsgi_include uwsgi_params;
uwsgi_pass unix:///var/sockets/$host.sock;
}
So i only need to set the socket name in every single uWSGI instance to
the app hostname without touching nginx.conf
--
Roberto De Ioris
http://unbit.it
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi