Hi,
I'm glad to announce a new release of NGINX Unit.
It is yet another big release, featuring ASGI support for Python and a long list
of other improvements and bug fixes.
ASGI 3.0 is a modern standardized interface that enables writing natively
asynchronous web applications making use of the async/await feature available
inlatest versions of Python. Now, Unit fully supports it along with WSGI.
Even more, Unit automatically detects the interface your Python app is using
(ASGI or WSGI); the configuration experience remains the same, though. Also,
our take on ASGI relies on Unit's native high-perf capabilities to implement
WebSockets.
To learn more about the new feature, check out the documentation:
- https://unit.nginx.org/configuration/#python
In addition, we've prepared for you a couple of howtos on configuring popular
ASGI-based frameworks with Unit:
- Quart: https://unit.nginx.org/howto/quart/ (note a simple WebSocket app)
- Starlette: https://unit.nginx.org/howto/starlette/
Finally, we've updated the Django howto to include the ASGI alternative:
- https://unit.nginx.org/howto/django/
Changes with Unit 1.20.0 08 Oct 2020
*) Change: the PHP module is now initialized before chrooting; this
enables loading all extensions from the host system.
*) Change: AVIF and APNG image formats added to the default MIME type
list.
*) Change: functional tests migrated to the pytest framework.
*) Feature: the Python module now fully supports applications that use
the ASGI 3.0 server interface.
*) Feature: the Python module now has a built-in WebSocket server
implementation for applications, compatible with the HTTP & WebSocket
ASGI Message Format 2.1 specification.
*) Feature: automatic mounting of an isolated "/tmp" file system into
chrooted application environments.
*) Feature: the $host variable contains a normalized "Host" request
value.
*) Feature: the "callable" option sets Python application callable
names.
*) Feature: compatibility with PHP 8 RC 1. Thanks to Remi Collet.
*) Feature: the "automount" option in the "isolation" object allows to
turn off the automatic mounting of language module dependencies.
*) Bugfix: "pass"-ing requests to upstreams from a route was broken; the
bug had appeared in 1.19.0. Thanks to 洪志道 (Hong Zhi Dao) for
discovering and fixing it.
*) Bugfix: the router process could crash during reconfiguration.
*) Bugfix: a memory leak occurring in the router process; the bug had
appeared in 1.18.0.
*) Bugfix: the "!" (non-empty) pattern was matched incorrectly; the bug
had appeared in 1.19.0.
*) Bugfix: fixed building on platforms without sendfile() support,
notably NetBSD; the bug had appeared in 1.16.0.
I would very much like to highlight one of these changes. Perhaps the least
noticeable, it is still important for the entire project: our functional tests
moved to a more feature-rich pytest framework from the native Python unittest
module that we've used previously. This change should enable us to write more
sophisticated tests, boosting the overall quality of our future releases.
All in all, this is a genuinely solid release, but I'm still more excited
about the things yet to come. Yes, even more great features are coming our
way very shortly! Right now, we are tinkering with route matching patterns
to support regular expressions; working on keepalive connection caching;
adding multithreading to application modules; and finally, fabricating the
metrics API!
We encourage you to follow our roadmap on GitHub, where your ideas and requests
are always more than welcome:
- https://github.com/orgs/nginx/projects/1
Stay tuned!
wbr, Valentin V. Bartenev
Hi,
I'm glad to announce a new release of NGINX Unit.
Our two previous releases were thoroughly packed with new features and
capabilities, but Unit 1.21.0 isn't an exception either. This is our
third big release in a row, with only six weeks since the previous one!
Perhaps, the most notable feature of this release is the support for
multithreaded request handling in application processes. Now, you can
fine-tune the number of threads used for request handling in each
application process; this improves scaling and optimize memory usage.
As a result, your apps can use a combination of multiple processes and
multiple threads per each process for truly dynamic scaling; the feature
is available for any Java, Python, Perl, or Ruby apps out of the box
without any need to update their code.
Moreover, if you make use of ASGI support in Unit (introduced in the
previous release), each thread of each process of your application
can run asynchronously. Pretty neat, huh?
To configure the number of threads per process, use the "threads" option
of the application object:
- https://unit.nginx.org/configuration/#applications
Yet another cool feature is the long-awaited support for regular expressions.
In Unit, they enable granular request filtering and routing via our compound
matching rules; now, with PCRE syntax available, your request matching
capabilities are limited only by your imagination. For details and examples,
see our documentation:
- https://unit.nginx.org/configuration/#routes
Changes with Unit 1.21.0 19 Nov 2020
*) Change: procfs is mounted by default for all languages when "rootfs"
isolation is used.
*) Change: any characters valid according to RFC 7230 are now allowed in
HTTP header field names.
*) Change: HTTP header fields with underscores ("_") are now discarded
from requests by default.
*) Feature: optional multithreaded request processing for Java, Python,
Perl, and Ruby apps.
*) Feature: regular expressions in route matching patterns.
*) Feature: compatibility with Python 3.9.
*) Feature: the Python module now supports ASGI 2.0 legacy applications.
*) Feature: the "protocol" option in Python applications aids choice
between ASGI and WSGI.
*) Feature: the fastcgi_finish_request() PHP function that finalizes
request processing and continues code execution without holding onto
the client connection.
*) Feature: the "discard_unsafe_fields" HTTP option that enables
discarding request header fields with irregular (but still valid)
characters in the field name.
*) Feature: the "procfs" and "tmpfs" automount isolation options to
disable automatic mounting of eponymous filesystems.
*) Bugfix: the router process could crash when running Go applications
under high load; the bug had appeared in 1.19.0.
*) Bugfix: some language dependencies could remain mounted after using
"rootfs" isolation.
*) Bugfix: various compatibility issues in Java applications.
*) Bugfix: the Java module built with the musl C library couldn't run
applications that use "rootfs" isolation.
Also, packages for Ubuntu 20.10 "Groovy" are available in our repositories:
- https://unit.nginx.org/installation/#ubuntu-2010
Thanks to Sergey Osokin, the FreeBSD port of Unit now provides an almost
exhaustive set of language modules:
- https://www.freshports.org/www/unit/
We encourage you to follow our roadmap on GitHub, where your ideas and requests
are always more than welcome:
- https://github.com/orgs/nginx/projects/1
Stay tuned!
wbr, Valentin V. Bartenev
Hello,
I'm having some trouble with running unit in a Docker container as an
unprivileged (random) user. The image will run in Openshift later,
that's why I have a random user. In my Docker file I have the following:
...
RUN mkdir -p /opt/unit/state/ /opt/unit/tmp/ && chmod -R a+w /opt/unit/
...
CMD ["unitd", "--no-daemon", "--control", "*:7777", "--pid",
"/opt/unit/unit.pid", "--state", "/opt/unit/state/", "--tmp",
"/opt/unit/tmp/", "--log", "-"]
When I run the image I get the following output:
2020/11/10 07:31:08 [warn] 1#1 Unit is running unprivileged, then it
cannot use arbitrary user and group.
2020/11/10 07:31:08 [info] 1#1 unit started
2020/11/10 07:31:08 [alert] 1#1 unlink("/opt/unit/unit.pid") failed (2:
No such file or directory)
There are no error, unitd just quit with exit code 1. What am I doing
wrong here and how do I get some more information out of the process to
find the error?
Kind regards,
Tobias
Good day.
For huge OCR service we need link about 100 arm single board computer by
TCP.
How does it possible to run OCR, DJVU and ZIP dynamic c++ libraries on
NGINX Unit??
Does it possible to use NGINX module for that?
for example
nginx-c-function It is a NGINX module that allow you to link your
.so(c/c++) application
https://github.com/Taymindis/nginx-c-functionhttps://www.nginx.com/resources/wiki/modules/
Will be really appreciated for any help.
Alexander Stroganov
Open Source Buddhism Library
www.buddism.ru/ocrlibhttps://github.com/Taymindis/nginx-link-function
On 09/11/20 01:25, unit-request(a)nginx.org wrote:
> Mailing list subscription confirmation notice for mailing list unit
>
> We have received a request from 87.236.26.40 for subscription of your
> email address,"gomde(a)mail.ru", to theunit(a)nginx.org mailing list.
> To confirm that you want to be added to this mailing list, simply
> reply to this message, keeping the Subject: header intact. Or visit
> this web page:
>
> https://mailman.nginx.org/mailman/confirm/unit/157b9c8f33bddfbee8b122f25385…
>
>
> Or include the following line -- and only the following line -- in a
> message tounit-request(a)nginx.org:
>
> confirm 157b9c8f33bddfbee8b122f25385d71cbaca69a2
>
> Note that simply sending a `reply' to this message should work from
> most mail readers, since that usually leaves the Subject: line in the
> right form (additional "Re:" text in the Subject: is okay).
>
> If you do not wish to be subscribed to this list, please simply
> disregard this message. If you think you are being maliciously
> subscribed to the list, or have any other questions, send them to
> unit-owner(a)nginx.org.