Uwsgi

Latest version: v2.0.28

Safety actively analyzes 688634 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 7 of 11

1.9.21.1

Not secure

1.9.21

Not secure
Latest 1.9 before 2.0 (scheduled at December 30th 2013)

From now on, all of the releases will be -rc's (no new features will be added)

A document describing notes for upgrades from the (extremely obsolete) 1.2 and 1.4 versions is on work.

This release includes a new simplified plugins builder subsystem directly embedded in the uWSGI binary.

A page reporting third plugins is available: :doc:`ThirdPartyPlugins` (feel free to add yours)

And now....

Changelog [20131211]

Bugfixes
********

- croak if the psgi streamer fails
- allows building coroae on raspberrypi
- do not wait for write availability until strictly required
- avoid segfault when async mode api is called without async mode
- fixed plain (without suspend engine) async mode
- do not spit errors on non x86 timerfd_create
- support timerfd_create/timerfd_settime on __arm__

Optimizations
*************

writev() for the first chunk
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Inernally when the first response body is sent, uWSGI check if response headers have been sent too, and eventually send them with an additional write() call.

This new optimizations allows uWSGI to send both headers and the first body chunk with single writev() syscall.

If the writev() returns with an incomplete write on the second vector, the system will fallback to simple write().

use a single buffer for websockets outgoing packets
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Before this patch every single websocket packet required to allocate a memory chunk.

This patch forces the reuse of a single dynamic buffer. For games this should result in a pretty good improvement in responsiveness.

New features
************

removed zeromq api
^^^^^^^^^^^^^^^^^^

The zeromq api (a single function indeed) has been removed. Each plugin rquiring zeromq cam simply call zmq_init() insteadd of uwsgi_zeromq_init().

The mongrel2 support has been moved to a 'mongrel2' plugin.

To pair uWSGI with mongrel2 the same options as before can be used, just remember to load (and build) the mongrel2 plugin

The new sharedarea
^^^^^^^^^^^^^^^^^^

The shared area subsystem has been rewritten (it is incompatible with the old api as it requires a new argument as it now supports multiple memory areas).

Check updated docs: :doc:`SharedArea`

report request data in writers and readers
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

every error when reading and writing to/from the client will report current request's data.

This should simplify debugging a lot.

Modular logchunks management
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The uWSGI api has been extended to allow plugins to define their log-request vars.

Check: :doc:`LogFormat`

tmsecs and tmicros, werr, rerr, ioerr, var.XXX
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

6 new request logging variables are available:

tmsecs: report the current unix time in milliseconds

tmicros: report the current unix time in microseconds

werr: report the number of write errors for the current request

rerr: report the number of read errors for the current request

ioerr: the sum of werr and rerr

var.XXX: report the context of the request var XXX (like var.PATH_INFO)

mountpoints and mules support for symcall
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The symcall plugin has been improved to support mules and mountpoints.

To run a C function in a mule just specify it as ``--mule=foobar()`` when the mule finds an argument ending
with () it will consider it a function symbol.

read2 and wait_milliseconds async hooks
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This two non-blocking hooks adds new capabilities to the non-blocking system.

The first one allows to wait on two file descriptors with the same call (currently implemented only in plain async mode)

The second one is used to have a millisecond resolution sleep. (this is currently used only by the sharedarea waiting system)

websockets binary messages
^^^^^^^^^^^^^^^^^^^^^^^^^^

You can now send websocket binary message. Just use ``uwsgi.websocket_send_binary()`` instead of ``uwsgi.websocket_send()``

the 'S' master fifo command
^^^^^^^^^^^^^^^^^^^^^^^^^^^

Sending 'S' to the master fifo, enable/disable the sending of subscription packets

as-mule hook
^^^^^^^^^^^^

this new custom hooks allows you to execute custom code in every mule:

.. code-block:: ini

[uwsgi]
hook-as-mule = exec:myscript.sh
...


accepting hook and improved chain reloading
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The chain reloading subsystem has been improved to take in account when a worker is really ready to accept() requests.

This specific state is announced to the Emperor too.

Check this article for more infos: https://uwsgi-docs.readthedocs.io/en/latest/articles/TheArtOfGracefulReloading.html

--after-request-call
^^^^^^^^^^^^^^^^^^^^

this option allows you to call specific C functions (in chains) after each request. While you should use the framework/interface features for this kind of job, sometimes it is not possible to execute
code after the logging phase. In such a case feel free to abuse this option.

error pages
^^^^^^^^^^^

Three new options allow the definition of custom error pages (html only):

``--error-page-403 <file>`` add an error page (html) for managed 403 response

``--error-page-404 <file>`` add an error page (html) for managed 404 response

``--error-page-500 <file>`` add an error page (html) for managed 500 response

Simplified plugins builder
^^^^^^^^^^^^^^^^^^^^^^^^^^

Building uWSGI plugins is now super easy:

.. code-block:: sh

uwsgi --build-plugin <directory>

this option will create a sane environment based on the current binary (no need to fight with build profiles and #ifdef) and will build the plugin.

No external files (included uwsgi.h) are needed as the uWSGI binary embeds them.


TODO for 2.0
************

- implement websockets and sharedarea support in Lua
- complete sharedarea api for CPython, Perl, Ruby and PyPy
- implement read2 and wait_milliseconds hook in all of the available loop engines

Availability
************

uWSGI 1.9.21 has been released on December 11th 2013 and can be downloaded at:

https://projects.unbit.it/downloads/uwsgi-1.9.21.tar.gz

1.9.20

Not secure
Changelog [20131117]

First round of deprecations and removals for 2.0
************************************************

* The Go plugin is now considered "broken" and has been moved away from the ``plugins`` directory. The new blessed way for running Go apps in uWSGI is using :doc:`GCCGO` plugin.
* The ``--auto-snapshot`` option has been removed, advanced management of instances now happens via :doc:`MasterFIFO`.
* The matheval support has been removed, while a generic "matheval" plugin (for internal routing) is available (but not compiled in by default). See below for the new way for making "math" in config files.
* The "erlang" and "pyerl" plugins are broken and has been moved out of the ``plugins`` directory. Erlang support will be completely rewritten after 2.0 release.

Next scheduled deprecations and removals
****************************************

The ZeroMQ API (a single function indeed) will be removed. Each plugin using ZeroMQ will create its own ``zmq`` context (no need to share it). This means libzmq will no more be linked in the uWSGI core binary.

Mongrel2 protocol support will be moved to a "mongrel2" plugin instead of being embedded in the core.

Bugfixes
********

* Fixed master hang when gracefully reloading in lazy mode.
* Fixed ``default_app`` usage.
* Another round of coverity fixes by Riccardo Magliocchetti.
* Fixed ``EAGAIN`` management when reading the body.

New features
************

64bit return values for the RPC subsystem
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Before this release every RPC response was limited to a size of 64k (16bit).

Now the RPC protocol automatically detects if more space is needed and can scale up to 64bit.

Another advantage of this approach is that only the required amount of memory per-response is allocated instead of blindly
creating a 64k chunk every time.

The new GCCGO plugin
^^^^^^^^^^^^^^^^^^^^

Check official docs: :doc:`GCCGO`

The plugin is in early stage of development but it's already quite solid.

Simple math in configuration files
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

As seen before, we have removed matheval support in favor of a simplified interface:

https://uwsgi-docs.readthedocs.io/en/latest/Configuration.html#placeholders-math-from-uwsgi-1-9-20-dev

For example, now you can automatically set the number of threads to:

.. code-block:: ini

[uwsgi]
; %k is a magic var translated to the number of cpu cores
threads = %(%k * 3)
...

(``%k * 3`` is ``number_of_cpu_cores * 3``).

New magic vars
^^^^^^^^^^^^^^

``%t``
Unix time (in seconds, gathered at instance startup).

``%T``
Unix time (in microseconds, gathered at instance startup).

``%k``
Number of detected CPU cores.

Perl/PSGI improvements
^^^^^^^^^^^^^^^^^^^^^^

* :doc:`Chunked`.
* ``psgix.io`` is a ``Socket::IO`` object mapped to the connection file descriptor (you need to enable it with ``--psgi-enable-psgix-io``).
* ``uwsgi::rpc`` and ``uwsgi::connection_fd`` from the API.
* ``--plshell`` will invoke an interactive shell (based on ``Devel::REPL``).

New native protocols: ``--https-socket`` and ``--ssl-socket``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

When built with SSL support, uWSGI exposes two new native socket protocols: HTTPS and uwsgi over SSL.

Both options take the following value: ``<addr>,<cert>,<key>[,ciphers,ca]``.

.. code-block:: ini

[uwsgi]
https-socket = :8443,foobar.crt,foobar.key
...

Currently none of the mainstream webservers support uwsgi over SSL, a patch for nginx will be sent for approval in the next few hours.

PROXY (version1) protocol support
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Recently Amazon ELB added support for HAProxy PROXY (version 1) protocol support. This simple protocol allows the frontend to pass
the real IP of the client to the backend.

Adding ``--enable-proxy-protocol`` will force the ``--http-socket`` to check for a PROXY protocol request for setting the ``REMOTE_ADDR`` and ``REMOTE_PORT`` fields.

New metrics collectors
^^^^^^^^^^^^^^^^^^^^^^

``avg``
Compute the math average of children: ``--metric name=foobar,collector=avg,children=metric1;metric2``.

``accumulator``
Always add the value of the specified children to the final value.

``multiplier``
Multiply the sum of the specified children for the value specified in ``arg1n``.

Check :doc:`Metrics`.

Availability
************

uWSGI 1.9.20 has been released on 20131117 and can be downloaded from
https://projects.unbit.it/downloads/uwsgi-1.9.20.tar.gz.

1.9.19

Not secure
Changelog [20131109]

This release starts the 'hardening' cycle for uWSGI 2.0 (scheduled for the end of december 2013).

The metrics subsystem was the last piece missing and this version (after 1 year of analysis) finally includes it.

During the following 2 months we will start deprecating features or plugins that got no-interest, are known to be broken or are simply superseed
by more modern/advanced ones.

Currently the following plugin and features are scheduled for removal:

- The Go plugin, superseeded by the gccgo one. (eventually the Go plugin will be brought back if something changes in the fork() support)
- Auto-snapshotting, was never documented, it has tons of corner case bugs and it is huber-complex. The features added by the :doc:`MasterFifo` allows for better implementations of snapshotting.

Waiting for decision:

- the erlang plugin is extremely old, was badly engineered and should be completely rewritten. If you are a user of it, please contact the staff. Very probably we will not be able to maintain it without sponsorship.
- the matheval support could be removed soon (unless we find some specific use that could require it), substituted by some form of simple math directly implemented in the option parser
- the admin plugin should be substituted with something more advanced. An api for defining dynamic options is on-work

Bugfixes
********

- completely skip cgroups initialization when non-root
- tons of post-static_analysis fixes by Riccardo Magliocchetti
- fixed the greenlet plugin reference counting
- avoid kevent storm for stats pusher thread
- fixed rbtimers math
- both 'cache' and 'file' routers got a 'no_content_length' key option to avoid settign the Content-Length header
- the PyPy plugin automatically enables threads/GIL
- manage dot_segments in HTTP parser
- improved srand() usage

New features
************

The Metrics subsystem
^^^^^^^^^^^^^^^^^^^^^

This was the last piece missing before uWSGI 2.0. The Metrics subsystem allows you to store "numbers" related to monitoring, graphing and quality checks and exports them in various ways.

Official docs: :doc:`Metrics`

The Tornado loop engine
^^^^^^^^^^^^^^^^^^^^^^^

While working on nodejs integration we realized that contrary to what we used to believe, Tornado (an asynchronous, callback based module for python) is usable in uWSGI.

Note: The plugin is not built-in by default

Official docs: :doc:`Tornado`

The 'puwsgi' protocol
^^^^^^^^^^^^^^^^^^^^^

A "persistent" (keep-alive) version of the 'uwsgi' parser has been added named 'puwsgi' (persistent uwsgi).

This protocol works only for request without a body and requires support from the frontend. Its use is currently for custom clients/apps, there is no webserver handler supporting it.

The ``--puwsgi-socket <addr>`` will bind a puwsgi socket to the specified address

--vassal-set
^^^^^^^^^^^^

You can tell the Emperor to pass specific options to every vassal using the --set facility:

.. code-block:: ini

[uwsgi]
emperor = /etc/uwsgi/vassals
vassal-set = processes=8
vassal-set = enable-metrics=1

this will add ``--set processes=8`` and ``--set enable-metrics=1`` to each vassal


The 'template' transformation
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This is a transformation allowing you to apply all of the internal routing patterns to your responses.

Take the following file (foo.html)

.. code-block:: html

<html>
<head>
<title>Running on ${SERVER_NAME}</title>
</head>
<body>
Your ip address is: ${REMOTE_ADDR}<br/>
Served requests: ${metric[worker.0.requests]}<br/>
Pid: ${uwsgi[pid]}<br/>
A random UUID: ${uwsgi[uuid]}
</body>
</html>

we will apply the 'template' transformation to it:

.. code-block:: ini

[uwsgi]
http-socket = :9090
; enable the metrics subsystem
enable-metrics = true
; inject the route transformation
route-run = template:
; return a file (transformation will be applied to it)
route-run = file:filename=foo.html,no_content_length=1

everything available in the internal routing subsystem can be used into the template transformation.

Performance are stellar, so instead of old Server Side Includes, you may want to try it.

Not enough ? combine it with caching:

.. code-block:: ini

[uwsgi]
http-socket = :9090
; enable the metrics subsystem
enable-metrics = true
; load foo.html in the cache
cache2 = name=mycache,items=10
load-file-in-cache = foo.html
; inject the route transformation
route-run = template:
; return the cache item (transformation will be applied to it)
route-run = cache:key=foo.html,no_content_length=1

Again ?

what about chunked encoding ?

.. code-block:: ini

[uwsgi]
http-socket = :9090
; enable the metrics subsystem
enable-metrics = true
; load foo.html in the cache
cache2 = name=mycache,items=10
load-file-in-cache = foo.html
; inject the route transformation
route-run = template:
; inject chunked encoding
route-run = chunked:
; return the cache item (transformation will be applied to it)
route-run = cache:key=foo.html,no_content_length=1

or gzip ?

.. code-block:: ini

[uwsgi]
http-socket = :9090
; enable the metrics subsystem
enable-metrics = true
; load foo.html in the cache
cache2 = name=mycache,items=10
load-file-in-cache = foo.html
; inject the route transformation
route-run = template:
; inject gzip
route-run = gzip:
; return the cache item (transformation will be applied to it)
route-run = cache:key=foo.html,no_content_length=1

Availability
************

uWSGI 1.9.19 has been released on 20131109, you can download it from:

https://projects.unbit.it/downloads/uwsgi-1.9.19.tar.gz

1.9.18.2

Not secure

1.9.18.1

Not secure

Page 7 of 11

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.