[uWSGI] status update for 0.9.6
Roberto De Ioris
roberto at unbit.it
Tue Jul 20 16:36:00 CEST 2010
Hi all, the 0.9.6 development is going on fast, and amazing new features has been added.
This is the current status, i think we will be able to release a first RC during the first week of August.
- Embedded HTTP server
This is one of the most requested feature.
Simply run uwsgi passing the --http option followed by the address to bind on:
./uwsgi --http :3333 -w simple_app
Now on port 3333 you will have a multithreaded webserver that forward request to uWSGI workers.
If you do not specify the -s/--socket option uWSGI will bind the workers to a random UNIX socket
This feature will speed-up testing and development of the uWSGI project, but even of your WSGI apps
development as you can use only uWSGI to run apps on your local machine.
The http server is on early stage of development, and is not secure as it does not check for overflow, but we will address this
in the next days. (and in the mean time you can use it for development, as i do not think you want to buffer overflow yourself ;) )
*** Warning ***
the embedded http server is only meant for development and testing, do not use it in production environment.
HTTP is slow , the uwsgi protocol is fast :)
- Routing
The uWSGI routing is a new feature for users that do not need a full framework for their apps but still need
a routing system to (fast) map url to python callable.
For now only routing via xmlconf is supported.
The syntax is simple:
<route method="GET|POST" pattern="^/ciccia/(\d+)/(\w+)$">view1</route>
this will call the view1() callable on matched pattern and method.
There are a lot of options, expect official docs soon
The routing system requires the libpcre
- Embedded plugin support
http://projects.unbit.it/uwsgi/wiki/PSGI
- VirtualHosting mode:
http://projects.unbit.it/uwsgi/wiki/VirtualHosting
- New commodity options
uWSGI 0.9.6 will add tons of new options to make administrators happy
--logdate (will add timestamp to every logline)
--chdir X (chdir to X at startup)
--env K=V (set environment variable)
--mode (set deploy mode, see below)
- Advanced (and funny) XML configurations
The uWSGI configuration do not need to be the only one in the xml file.
You could have an app-specific xml config file in which you can include the uwsgi configuration:
myapp.xml
<pippo>
<setting1>0</setting1>
<pluto/>
<topolino>1</topolino>
<uwsgi>
<module>djangoapp</module>
<master/>
<socket>:3033</socket>
</uwsgi>
</pippo>
You can even put multiple uwsgi configuration in the same file using the "id" feature
megaconf.xml
<wsgiapps>
<uwsgi id="one.unbit.it">
<module>app1</module>
<socket>:3031</socket>
<processes>5</processes>
</uwsgi>
<uwsgi id="two.unbit.it">
<module>app2</module>
<socket>:3032</socket>
<processes>5</processes>
</uwsgi>
<uwsgi id="three.unbit.it">
<module>app3</module>
<socket>:3033</socket>
<processes>4</processes>
<master/>
</uwsgi>
<uwsgi id="test">
<module>testapp</module>
<socket>127.0.0.1:8080</socket>
<processes>1</processes>
</uwsgi>
</wsgiapps>
Now simply run uwsgi specifying the id:
./uwsgi -x megaconf.xml:one.unbit.it
./uwsgi -x megaconf.xml:two.unbit.it
./uwsgi -x megaconf.xml:three.unbit.it
./uwsgi -x megaconf.xml:test
Another useful feature is the "mode" option. You can define xml parameters
based on the "mode"
hello.xml
<uwsgi>
<module>funnyapp</module>
<processes mode="development">1</processes>
<processes mode="production">8</processes>
<master mode="production" />
<memory-report mode="development" />
</uwsgi>
./uwsgi -x hello.xml --mode production
will load only the option marked as "production" and those without mode
./uwsgi -x hello.xml --mode development
will load only the option marked as "development" and those without mode
./uwsgi -x hello.xml
will load all the options
- Stylish module loading
You can load module/callable using "gunicorn" style:
./uwsgi -s :3031 --env TRAC_ENV=/tmp/mytrac -w trac.web.main:dispatch_request
will run trac on port 3031 without defining config files :)
(look at the --env option)
--- Stll-in-dev features ---
the evdis framework
better app loaders
performance counters
ipv6
remove unix socket file on exit
safely discard http body
logrotate
better integration with supervisord (for users that do not want to use the uWSGI master process)
AIX official support
run-by-root improvements
--
Roberto De Ioris
http://unbit.it
JID: roberto at jabber.unbit.it
More information about the uWSGI
mailing list