# HG changeset patch # User Jiří Setnička <jiri.setnicka@cdn77.com> # Date 1643385660 -3600 # Fri Jan 28 17:01:00 2022 +0100 # Node ID 535e503156cf141bf9471895468423e82f68c8bb # Parent 64ff9068a0bd89712a0ae6fc589a881869663642 Cache: Shared memory for tempfile nodes New option for `proxy_cache_path`: `tf_zone=name:size` (defaults to key zone name with `_tf` suffix and 10M size). Itby Jiří Setnička via nginx-devel - Nginx Development
Hello! Over the last few months, we (a small team of developers including me and Jan Prachař, both from CDN77) developed a missing feature for the proxy caching in Nginx. We are happy to share this feature with the community in the following patch series. We serve a large number of files to an immense number of clients and often multiple clients want the same file at the very same time - especiby Jiří Setnička via nginx-devel - Nginx Development
details: https://hg.nginx.org/nginx/rev/0b5f12d5c531 branches: changeset: 7981:0b5f12d5c531 user: Maxim Dounin <mdounin@mdounin.ru> date: Sat Dec 25 01:07:15 2021 +0300 description: PCRE2 library support. The PCRE2 library is now used by default if found, instead of the original PCRE library. If needed for some reason, this can be disabled with the --without-pcre2 configure oby Maxim Dounin - Nginx Development
Hello! On Tue, Dec 14, 2021 at 07:09:09PM +0300, Maxim Dounin wrote: > Full series updated: > > # HG changeset patch > # User Maxim Dounin <mdounin@mdounin.ru> > # Date 1639495851 -10800 > # Tue Dec 14 18:30:51 2021 +0300 > # Node ID 4f979a9f2a68b25b8b2ce8a0bd15671095f6c327 > # Parent a7a77549265ef46f1f0fdb3897f4beabf9e09c40 > Core: fixed ngx_pcre_studiesby Maxim Dounin - Nginx Development
Hello, Thank you for your reply. The build works fine after applying the additional patch. Thanks. -- Tatsuhiko Kubo 2021年12月15日(水) 1:09 Maxim Dounin <mdounin@mdounin.ru>: > > Hello! > > On Tue, Dec 14, 2021 at 03:09:43PM +0900, Tatsuhiko Kubo wrote: > > > Hello, > > > > I'm trying these patches and the build of nginx with the option > > &qby cubicdaiya - Nginx Development
Hello! On Tue, Dec 14, 2021 at 03:09:43PM +0900, Tatsuhiko Kubo wrote: > Hello, > > I'm trying these patches and the build of nginx with the option > "--with-pcre-jit" fails. > > $ cd nginx-1.21.4 # with applied patches > $ ./configure --with-pcre=../pcre2/pcre2-10.39 --with-pcre-jit > $ make > ... > cc -c -pipe -O -Wall -Wextra -Wpointer-arith > -Wcby Maxim Dounin - Nginx Development
# HG changeset patch # User Maxim Dounin <mdounin@mdounin.ru> # Date 1639235687 -10800 # Sat Dec 11 18:14:47 2021 +0300 # Node ID dfd93beb55f7ea950efa80a580b3ffc571588d5b # Parent 84fae18c1b1e9d5cfafe10e0e9754f1d7ba628e1 PCRE2 library support. The PCRE2 library is now used by default if found, instead of the original PCRE library. If needed for some reason, this can be disabled withby Maxim Dounin - Nginx Development
details: https://hg.nginx.org/njs/rev/66bd2cc7fd87 branches: changeset: 1719:66bd2cc7fd87 user: Alexander Borisov <alexander.borisov@nginx.com> date: Mon Oct 11 17:46:24 2021 +0300 description: Fixed copying of closures for declared functions. After 0a2a0b5a74f4 (0.6.0), the referencing of a closure value inside of a nested function may result in heap-use-after-free. For thiby Alexander Borisov - Nginx Development
# HG changeset patch # User Junli Liu<jlliudh@isoftstone.com> # Date 1631003347 -28800 # Tue Sep 07 16:29:07 2021 +0800 # Node ID 301a837387ed63bb2e455942ef2ef79bc9aaa972 # Parent 2245324a507abc54cf0274fd1b1e81bfac7c1c73 OpenSSL-1.1.0:Support Asynchronous Operations of SSL with openSSL-1.1.0 Security is critical to the foundation of networking and Transport Layer Security (TLS) is tby Junli Liu - Nginx Development
Hi Mikhail, Yes, io_uring can help Nginx achieve same performance with lower resource cost. This is the key improvement of io_uring I think. It can't break through the HW limitation. BR, Ping -----Original Message----- From: nginx-devel <nginx-devel-bounces@nginx.org> On Behalf Of Mikhail Isachenkov Sent: Friday, February 26, 2021 4:41 PM To: nginx-devel@nginx.org Subject: Re: Aby Zhao, Ping - Nginx Development
Hi Zhao Ping, I created i3en.6xlarge instance, 2 SSDs with 250k iops each (in raid0) and reproduced your results. Please find dstat output below. 1 worker, io_uring: usr sys idl wai stl| read writ| recv send| in out | int csw 4 4 92 0 0|1412M 0 |5742k 1484M| 0 0 | 244k 87k 1 worker, libaio: usr sys idl wai stl| read writ| recv send| in out | int cswby Mikhail Isachenkov - Nginx Development
Hi Mikhail, My Nvme SSD reports 562k IOPS with bs 4k, 128 depth using io_uring. ./fio -name=fiotest -filename=/dev/nvme2n1 -iodepth=128 -thread -rw=randread -ioengine=io_uring -sqthread_poll=1 -direct=1 -bs=4k -size=10G -numjobs=1 -runtime=600 -group_reporting Jobs: 1 (f=1): [100.0%] fiotest: (groupid=0, jobs=1): err= 0: pid=23828: Fri Feb 26 03:55:40 2021 read: IOPS=562k, BW=2196MiB/by Zhao, Ping - Nginx Development
Hi Zhao Ping, Looks like general-purpose AWS EC2 instances does not optimized to high random I/O even with NVMe SSD; I'll try to test it again on bare-metal, storage-optimized instance. How many 4k random iops your storage can handle? (I'd like to run test on the instance with the same storage performance, according to https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/storage-optimized-insby Mikhail Isachenkov - Nginx Development
Hi Mikhail, I tried with CentOS 8.1.1911 + fedora-kernel-5.10.10-200.fc33, and with your test steps & scripts: 1. Created 90k files on nvme SSD with each size 100KB. 2. Created separate cgroup 'nginx': mkdir /sys/fs/cgroup/memory/nginx 3. Limit Nginx to 2GB: echo 2G > /sys/fs/cgroup/memory/nginx/memory.limit_in_bytes 4. Clear cache: echo 3 > /proc/sys/vm/drop_caches 5. Start ngby Zhao, Ping - Nginx Development
Hi Mikhail, My steps are almost same as yours. The context switches number(csw) seems related with the file size if other configurations are same. My previous data is with 4KB file(csw: ~90k). With 100KB file(csw: ~40k), 1MB file(csw: ~5k). Which kernel version are you using? I think if it's possible some problems in kernel. For 'io_uring_queue_init_params() failed (12: Cannot allocate memorby Zhao, Ping - Nginx Development
Hi! There was a regression detected in io_uring in kernel version 5.7.16 with TWA_SIGNAL handling. Looks like fix was not queued the stable branch, but could be backported to Fedora 33 kernel. It could potentially lead to some differences in metrics. Thanks, Vadim пн, 15 февр. 2021 г., 8:11 Mikhail Isachenkov <mikhail.isachenkov@nginx.com >: > Hi Zhao Ping, > > First of allby Vadim Fedorenko - Nginx Development
Hi Zhao Ping, First of all, happy Chinese New Year! Yes, I've checked this first. Nginx binary linked with liburing and, without 'ulimit -l unlimited', there were 'io_uring_queue_init_params() failed (12: Cannot allocate memory)' error in error.log. I believe that io_uring is working correctly. But, as I can see, numbers in last two columns of dstat output (interrupts and context switches)by Mikhail Isachenkov - Nginx Development
Hi Mikhail, Sorry for late. I'm on Chinese New Year holiday leave. I can't see any problem from your steps, but the result is different from mine. It's strange, I'll try when I'm back to office next week. Would you check the io_uring nginx with ldd to see if it's linked with liburing first? # ldd /path/to/nginx linux-vdso.so.1 (0x00007ffce4ff8000) libdl.so.2 => /lib64/liby Zhao, Ping - Nginx Development
Hi Zhao Ping, Unfortunately, I still couldn't reproduce these results. Maybe you could point me where I'm wrong? Please find my steps below and configuration/lua script for wrk attached. 1. Create 90k files on SSD on Amazon EC2 instance. I created 1k, 100k, 1M files. 2. Create separate cgroup 'nginx': mkdir /sys/fs/cgroup/memory/nginx 3. Limit memory to 80 Mb, for example: echo 80M>/sys/fby Mikhail Isachenkov - Nginx Development
Hi Mikhail, The performance improvement of Io_uring vs. libaio locates at disk io interface. So it needs exclude other factors when test, such as memory cache storage which is much faster than disk io. If I didn't use memory limitation, libaio and io_uring network bandwidth is very close because both of them use memory as cache file location, so we can't see the disk io change from it. In foby Zhao, Ping - Nginx Development
Hi, On Ubuntu 20.04, I've built the docker image based my project located at https://github.com/hongyi-zhao/docker-nginx-rtmp. The SSL relative configuration has been enabled in the nginx.conf file used by the above docker image, see https://github.com/hongyi-zhao/docker-nginx-rtmp/blob/master/nginx.conf for the detailed info. I then tried to stream the camera using HLS, as described below. Publby Hongyi Zhao - Nginx Development
details: https://hg.nginx.org/nginx/rev/559d19037984 branches: changeset: 7726:559d19037984 user: Maxim Dounin <mdounin@mdounin.ru> date: Thu Oct 08 17:44:34 2020 +0300 description: Limit req: unlocking of nodes on complex value errors. Previously, if there were multiple limits configured, errors in ngx_http_complex_value() during processing of a non-first limit resulted in reby Maxim Dounin - Nginx Development
details: https://hg.nginx.org/njs/rev/f7f7994b69b5 branches: changeset: 1525:f7f7994b69b5 user: Dmitry Volyntsev <xeioex@nginx.com> date: Fri Sep 18 18:00:32 2020 +0000 description: Added support for detached-buffers. diffstat: auto/cc | 4 + auto/help | 6 +- auto/options | 4 +- src/njs_array_buffer.c | 4 + src/njsby Dmitry Volyntsev - Nginx Development
details: https://hg.nginx.org/nginx/rev/847fd35f94de branches: changeset: 7704:847fd35f94de user: Sergey Kandaurov <pluknet@nginx.com> date: Fri Aug 04 19:37:37 2017 +0300 description: Cache: reset c->body_start when reading a variant on Vary mismatch. Previously, a variant not present in shared memory and stored on disk using a secondary key was read using c->body_startby Sergey Kandaurov - Nginx Development
Hello! On Wed, May 20, 2020 at 12:29:45PM +0800, Jim T wrote: > Nginx is famous for code readability and neat code format. I use the tool( > https://github.com/openresty/openresty-devel-utils) to try to unify the > incorrect front spaces, Here is my attempt at core. > > # HG changeset patch > # User Jinhua Tan <312841925@qq.com> > # Date 1589948492 -28800 > #by Maxim Dounin - Nginx Development
Hello! Nginx is famous for code readability and neat code format. I use the tool( https://github.com/openresty/openresty-devel-utils) to try to unify the incorrect front spaces, Here is my attempt at core. # HG changeset patch # User Jinhua Tan <312841925@qq.com> # Date 1589948492 -28800 # Wed May 20 12:21:32 2020 +0800 # Node ID 10678810de74edc4c02d5cd7303f0099eee9fac3 # Parent 3c80by Jim T - Nginx Development
Hi, Thank you for your contribution! 26.03.2020 16:37, Dulmandakh Sukhbaatar wrote: > Hello, > > I would like to propose to harden nginx.service with systems configurations, and this change uses PrivateDevices=yes, PrivateTmp=yes and ProtectSystem=full configs. And here are excerpts from man systemd.exec man page. > > PrivateDevices=yes > sets up a new /dev mount for the execby Konstantin Pavlov - Nginx Development
Hello, I would like to propose to harden nginx.service with systems configurations, and this change uses PrivateDevices=yes, PrivateTmp=yes and ProtectSystem=full configs. And here are excerpts from man systemd.exec man page. PrivateDevices=yes sets up a new /dev mount for the executed processes and only adds API pseudo devices such as /dev/null, /dev/zero or /dev/random (as well as the pseudo Tby Dulmandakh Sukhbaatar - Nginx Development
details: https://hg.nginx.org/njs/rev/ccfa84cea2b3 branches: changeset: 1316:ccfa84cea2b3 user: Dmitry Volyntsev <xeioex@nginx.com> date: Tue Feb 04 20:35:02 2020 +0300 description: Introduced memory-efficient arrays. 1) If "length" of ordinary array exceeds 32768 it is converted to to array-like object. 2) Array.prototype.concat() is rewritten according to the specby Dmitry Volyntsev - Nginx Development
Hello! On Wed, Jan 08, 2020 at 06:08:59PM -0800, Robert Paprocki wrote: > A curious point then, why ngx_atomic_fetch_add is used to > advance the buffer position, if an atomic operation isn’t > necessary since the buffer isn’t shared. Is it a style choice? It is to make debug logging work in threads. -- Maxim Dounin http://mdounin.ru/ ___________________________________________by Maxim Dounin - Nginx Development