./www/py-uwsgi, Feature-rich WSGI server

[ CVSweb ] [ Homepage ] [ RSS ] [ Required by ] [ Add to tracker ]

Branch: CURRENT, Version: 2.0.9, Package name: py27-uwsgi-2.0.9, Maintainer: pkgsrc-users

uWSGI is a fast (pure C), self-healing, developer-friendly WSGI server,
aimed for professional python webapps deployment and development.
Backend support exists for Apache, nginx, cherokee and lighttpd.

Some of the features include:
- low memory footprint
- preforking and multithreaded operation
- logging, diagnostic and profiling support
- support for sendfile()
- self-healing
- graceful restart and hot-plug upgrading

Required to run:
[textproc/libxml2] [devel/py-setuptools] [lang/python27]

Package options: libxml2, openssl, zlib

Master sites:

SHA1: 318d1d6d4bb57eb48b58361201cdc1cc7feedcbb
RMD160: 8a04d918f7dc192ebd385ff470a99665c9fc0cc1
Filesize: 760.98 KB

Version history: (Expand)

CVS history: (Expand)

   2015-01-10 23:26:54 by Adam Ciarcinski | Files touched by this commit (2)
Log message:
Changes 2.0.9:
fixed mod_proxy_uwsgi for non-blocking mode
fixed master-fifo + cheaper
fixed leak on error in bind_to_unix
atexit hooks works in cheaped workers too
atexit hooks works in gevent mode too during shutdown
fixed carbon command line option value after reload
do not honour Emperor throttling on the first run
fixed Mono plugin
fixed peer name in corerouters
fixed stop signal for daemons
varios ssl/tls fixes in https/spdy router
fixed python3 –py-auto-reload-ignore
fixed modifiers in corerouters
support for yajl from homebrew (OSX)
psgi: Ensure that we call any DESTROY hooks on psgix.harakiri.commit
systemdlogger: fix compilation with -Werror=format-security
fixed unmasked websockets
perl fixed latent refcounting bug

New Features:
Improved PyPy support for Linux
Fastrouter post-buffering
Perl uwsgi::opt
active-workers signal target
httpdumb routing action
   2014-11-30 17:56:58 by Blue Rats | Files touched by this commit (2)
Log message:
uWSGI 2.0.8

Note: this is the first version with disabled-by-default SSL3, if you need it, \ 
you can re-enable with --ssl-enable3 option

    fixed PHP SCRIPT_NAME usage when --php-app is in place
    allow "appendn" hook without second argument
    fix heap corruption in the Carbon plugin (credits: Nigel Heron)
    fix getifaddrs() memory management
    fixed tcsetattr() usage
    fixed kevent usage of return value (credits: Adriano Di Luzio)
    ensure PSGI response headers are in the right format
    fixed reloading of attached daemons
    fixed SSL/TLS shutdown
    fixed mountpoint logic for paths not ending with / (credits: Adriano Di Luzio)
    fixed Python3 support in spooler decorators (credits: Adriano Di Luzio)

New Features
RTSP and chunked input backports from 2.1 for the HTTP router

The --http-manage-rtsp and ``--http-chunked-input` have been backported from 2.1 \ 
allowing the HTTP router to detect RTSP and chunked requests automatically. This \ 
is useful for the upcoming https://github.com/unbit/uwsgi-realtime plugin.

This custom hook allows you to call actions after each fork().
fallback to trollius for asyncio plugin

If you build the asyncio plugin for python2, a fallback to the trollius module \ 
will be tried.

This feature has gotten basically zero test coverage, so every report (bug or \ 
success alike) is welcome.
added sweep_on_full, clear_on_full and no_expire to --cache2

Three new options for --cache2 have been added for improving the caching expire \ 

    sweep_on_full will call a sweep (delete all of the expired items) as soon as \ 
the cache became full
    clear_on_full will completely clear the cache as soon as it is full
    no_expire forces the cache to not generate a cache sweeper thread, \ 
delegating items removal to the two previous options

backported wait-for-fs/mountpoints from 2.1

    --wait-for-fs <path> suspend the uWSGI startup until a file/directory \ 
is available
    --wait-for-file <path> suspend the uWSGI startup until a file is available
    --wait-for-dir <path> suspend the uWSGI startup until a directory is \ 
    --wait-for-mountpoint <path> suspend the uWSGI startup until a \ 
mountpoint is available

improved the offload api (backport from 2.1)

uWSGI 2.0.8 is compatible with the upcoming \ 
https://github.com/unbit/uwsgi-realtime plugin that allows the use of realtime \ 
features (like websockets or audio/video streaming) using the uWSGI offload \ 
engine + Redis publish/subscribe.
Allows building plugins from remote sources as embedded

The UWSGI_EMBED_PLUGINS environment variable has been extended to support remote \ 
plugins. As an example you can build a monolithic uwsgi binary with the Avahi \ 
and realtime plugins as:

UWSGI_EMBED_PLUGINS="avahi=https://github.com/20tab/uwsgi-avahi,realtime=https://github.com/unbit/uwsgi-realtime" \ 

Automatically manage HTTP_X_FORWARDED_PROTO

Albeit a new standard is available in the HTTP world for forwarded sessions \ 
(http://tools.ietf.org/html/rfc7239) this release adds support for the \ 
X-Forwarded-Proto header, automatically setting the request scheme accordingly.
   2014-09-10 18:02:33 by Sebastian Wiedenroth | Files touched by this commit (2) | Package updated
Log message:
Update py-uwsgi to 2.0.7

uWSGI 2.0.7

Changelog [20140905]


- fixed counters in statsd plugin (Joshua C. Forest)
- fixed caching in php plugin (Andrew Bevitt)
- fixed management of system users starting with a number
- fixed request body readline using memmove instead of memcpy (Andrew Wason)
- ignore "user" namespace in setns (still a source of problems)
- fixed Python3 rpc bytes/string mess (result: we support both)
- do not destroy the Emperor on failed mount hooks
- fixed symbol lookup error in the Mono plugin on OS X (Ventero)
- fixed fastcgi and scgi protocols error when out of buffer happens
- fixed solaris/smartos I/O management
- fixed 2 memory leaks in the rpc subsystem (Riccardo Magliocchetti)
- fixed rados plugin PUT method (Martin Mlynář)
- fixed multiple python mountpoints with multiple threads in cow mode
- stats UNIX socket is now deleted by vacuum
- fixed off-by-one corruption in cache LRU mode
- force single-cpu build in cygwin (Guido Notari)

New Features and improvements

allow calling the spooler from every cpython context

At Europython 2014, Ultrabug (a uWSGI contributor and packager) asked for the \ 
possibility to spool tasks directly from a greenlet.


store_delete cache2 option

Author: goir

The store_delete flag of the --cache2 option, allows you to force the cache \ 
engine to automatically remove an invalid
backing store file.

file logger rotation

Author: Riccardo Magliocchetti

The `file` logger has been extended to allow the use of rotation (the same \ 
system used by the non-pluggable --logto):

https://github.com/unbit/uwsgi/commit/0 … 88ddab59c5

vassals plugin hooks

The plugin have has been extended with two new hooks: vassal and vassal_before_exec.

Both allows to customize a vassal soon after its process has been generated.

The first third-party plugin using it is the 'apparmor' one:


allowing you to apply an apparmor profile to a vassal

Broodlord improvements

The broodlord subsystem has been improved with a new option: --vassal-sos that \ 
automatically ask for reinforcement when all of the workers of an instance are \ 

In addition to this a sysadmin can now manually ask for reinforcement sending \ 
the 'B' commando to the master fifo of an instance.
   2014-08-07 07:34:35 by Blue Rats | Files touched by this commit (2) | Package updated
Log message:
uWSGI 2.0.6

Changelog [20140701]

    fixed a memory leak with subscription system
    fixed shortcut for ssl-socket
    fixed apache2 mod_proxy_uwsgi (it is now considered stable with all mpm engines)
    fixed SCRIPT_NAME and PATH_TRANSLATED generation in php plugin
    remove the old FIFO socket from the event queue when recreating it

New features
The new Rados plugins

The rados plugin has been improved and stabilized, and now it is considered \ 
usable in production.

Async modes and multithreading correctly works, and support for uploading \ 
objects (via PUT) and creating new pools (MKCOL) has been added.

Expect webdav support in uWSGI 2.1

Docs have been updated: http://uwsgi-docs.readthedocs.org/en/latest/Rados.html

This is a configuration logic for including options only when the specified \ 
hostname matches:

if-hostname = node1.local
  socket = /tmp/socket1.socket
endif =

if-hostname = node2.local
  socket = /var/run/foo.socket
endif =

Apache2 mod_proxy_uwsgi stabilization

After literally years of bug reports, and corrupted data, the mod_proxy_uwsgi is \ 
now stable, and on modern apache2 releases it supports unix sockets too.

Updated docs: http://uwsgi-docs.readthedocs.org/en/la … roxy-uwsgi
uwsgi[rsize] routing var

this routing var (meaningful only in the 'final' chain) exposes the response \ 
size of the request
the callint scheme

This scheme allows you to generate blob from functions exposed by your uWSGI \ 

uid = @(callint://get_my_uid)
gid = @(callint://get_my_gid)


The corerouters fallback procedure requires a valid key (domain name) has been \ 
requested. This option forces the various routers to trigger the fallback \ 
procedure even if a key has not been found.
php 5.5 opcode caching via -php-sapi-name

For mysterious reasons the opcode caching of php5.5 is not enabled in the embed \ 
sapi. This option (set it to 'apache' if you want) allows you to fake the opcode \ 
caching engine forcing it to enable itself.
Improved chain-reloading

Thanks to Marko Tiikkaja the chain reloading procedure correctly works in \ 
cheaper modes and it is more verbose.
added 'chdir' keyval to -attach-daemon2

You can now set where attached daemons need to chdir()
   2014-06-15 07:19:57 by Blue Rats | Files touched by this commit (2)
Log message:


    fixed support for repeated headers in lua plugin
    fixed support for embedding config in OpenBSD and NetBSD
    various fixes in the curl-based plugins
    fixed milliseconds-based waits
    fixed sharedarea poller
    fixed stats server json escaper
    fixed fastcgi parser and implemented eof management
    improved fast on-demand mode
    exclude avg_rt computation for static files
    fixed variables support in uwsgi internal router
    fixed websockets + keepalive ordering
    disable SIGPIPE management in corutines-based loop-engines
    fixed 64bit sharedarea management in 32bit systems
    honour chmod/chown-socket in fd0 mode
    hack for avoiding Safari iOS to make mess with keepalive
    fixed log setup when both --logto and --log2
    fixed mule_get_msg EAGAIN
    signal_pidfile returns the right error code
    fixed asyncio on OSX

New features
graceful reload of mule processes

SIGHUP is now sent to mules instead of directly killing them. You are free to \ 
trap/catch the signal in the code. If a mule does not die in the allowed \ 
"mercy time" (--mule-reload-mercy, default 60 seconds), SIGKILL will \ 
be sent.
return routing action

The new action will allow users to write simplified "break" clause.

For example, "return:403" is equivalent to "break:403 \ 
Forbidden", with response body "Forbidden".

The response body is quite useful for telling end users what goes wrong.

this new option, completely disables the blacklisting Emperor subsystem
Icecast2 protocol helpers

One of the upcoming unbit.com projects is a uWSGI based audio/video streaming server.

The plugin (should be released during europython 2014) already supports the \ 
Icecast2 protocol.

A bunch of patches have been added to the http router to support the icecast2 \ 

For example the --http-manage-source option allows the HTTP router to honour \ 
SOURCE method requests, automatically placing them in raw mode.
--metrics-no-cores, --stats-no-cores, --stats-no-metrics

When you have hundreds (or thousands) of async cores, exposing metrics of them \ 
could be really slow.

Three new options have been added allowing you to disable the generation of \ 
core-related metrics and (eventually) their usage in the stats server.
sharedarea improvements

The sharedarea api continues to improve. Latest patches include support for \ 
mmapping device directly from the command line.

A funny way for testing it, is mapping the raspberrypi BCM2835 memory, the \ 
following example allows you to read the rpi system timer

uwsgi --sharedarea file=/dev/mem,offset=0x20003000,size=4096 ...

now you can read the 64bit value from the first (zero-based) sharedarea:

# read 64bit from 0x20003004
timer = uwsgi.sharedarea_read64(0, 0x04)

obviously, pay attention when accessing rpi memory, an error could crash the \ 
whole system !!!

This exit code (15) can be raised by a worker to tell the master to not respawn it
PROXY1 support for the http router

The option --http-enable-proxy-protocol allows the HTTP router to understand \ 
PROXY1 protocol requests (like the ones made by haproxy or amazon elb)
reset_after_push for metrics

This metric attribute ensure that the matric value is reset to 0 (or its \ 
hardcoded initial_value) evry time the metric is pushed to some external system \ 
(like carbon, or statsd)

This routing action allows you to completely override the REMOTE_ADDR detected \ 
by protocol handlers:

; treat all requests as local
route-run = setremoteaddr:

the resolve option

There are uWSGI options (or plugins) that do not automatically resolves dns name \ 
to ip addresses. This option allows you to map a placeholder to the dns \ 
resolution of a string:

; place the dns resolution of 'example.com' in the 'myserver' placeholder
resolve = myserver=example.com
subscribe2 = server=%(myserver),key=foobar
   2014-05-03 21:09:48 by Blue Rats | Files touched by this commit (9)
Log message:
   2014-04-24 02:18:52 by Blue Rats | Files touched by this commit (2)
   2014-03-01 20:12:23 by Blue Rats | Files touched by this commit (2) | Package updated
Log message:
Updated to latest release, 2.0.2. From Changelog:


 * fixed python3 support on older compilers/libc
 * allow starting in spooler-only mode
 * fixed cache bitmap support and added test suite (credits: Danila Shtan)
 * fixed ftime log var
 * added async remote signal management
 * fixed end-for and end-if
 * fixed loop in internal-routing response chain
 * fixed pypy execute_source usage
 * logpipe: Don\u2019t setsid() twice (credits: INADA Naoki)

New features and improvements
CGI plugin

The plugin has been improved to support streaming.

In addition to this the long-awaited async support is finally ready. Now you can
have CGI concurrency without spawning a gazillion of expensive threads/processes

Check: Running CGI scripts on uWSGI
PSGI loading improvements

The PSGI loader now tries to use Plack::Util::load_psgi() function instead of
simple eval. This addresses various inconsistences in the environment (like the
double parsing/compilation/execution of psgi scripts).

If the Plack module is not available, a simple do-based code is used (very
similar to load_psgi)