<div><div><p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:".SF UI"" dir="auto"><span style="font-size:16px">Mathew</span></p><p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:".SF UI"" dir="auto"><span style="font-size:16px"><br></span></p><p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:".SF UI"" dir="auto"><span style="font-size:16px">Thank you for your feedback. </span></p><p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:".SF UI"" dir="auto"><span style="font-size:16px">I did not implement file management of Nginx with io_uring. </span></p><p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:".SF UI"" dir="auto"><span style="font-size:16px">So I think the performance improvement is mostly due to socket IO. </span></p><p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:".SF UI"" dir="auto"><span style="font-size:16px">I will try to implement asynchronous file interaction with io_uring later.  </span></p><p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:".SF UI"" dir="auto"><span style="font-size:16px"><br></span></p><p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:".SF UI"" dir="auto"><span style="font-size:16px">Also I will test proxy_pass / fastcgi_pass benchmarks and get back</span><span style="font-size:16px"> to you soon.</span></p><p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:".SF UI"" dir="auto"><span style="font-size:16px"><br></span></p><p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:".SF UI"" dir="auto"><span style="font-size:16px"><br></span></p><p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:".SF UI"" dir="auto"><span style="font-size:16px">Thank you. </span></p><p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:".SF UI"" dir="auto"><span style="font-size:16px">SoYun</span></p></div><div dir="auto"><br></div><div dir="auto">On Tue, Nov 24, 2020 at 6:09 PM Mathew Heard <<a href="mailto:mat999@gmail.com">mat999@gmail.com</a>> wrote:</div><div dir="auto"><div class="gmail_quote" dir="auto"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"><div><div class="gmail_quote"><div dir="ltr">SoYun,<div><br></div><div>Interesting patchset. Have you by chance also tested proxy_pass / fastcgi_pass performance?</div><div><br></div><div>I'd be interested to know if the significant performance improvement was due to filesystem interaction or socket.</div><div><br></div><div>Regards,<br>Mathew</div><div><br></div></div><br><div class="gmail_quote"></div></div></div><div><div class="gmail_quote"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 24 Nov 2020 at 19:43, SoYun Seong <<a href="mailto:thdbsdox12@gmail.com" target="_blank">thdbsdox12@gmail.com</a>> wrote:<br></div></div></div></div><div><div class="gmail_quote"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"></blockquote></div></div></div><div><div class="gmail_quote"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"># HG changeset patch<br>
# User SoYun Seong <<a href="mailto:thdbsdox12@gmail.com" target="_blank">thdbsdox12@gmail.com</a>><br>
# Date 1606129415 0<br>
#      Mon Nov 23 11:03:35 2020 +0000<br>
# Node ID d7420a5777b63c8a8cfb7e98a522893490995510<br>
# Parent  09dfe4a92414513c6bd3c18d871e8a76ed19c3d7<br>
new io_uring event module.<br>
<br>
I implemented ngx_uring_module using Linux io_uring API to improve performance of Nginx for Linux by minimizing system calls. There are performance improvements in both request/sec and average latency. The result is located at <a href="https://github.com/dachshu/nginx" rel="noreferrer" target="_blank">https://github.com/dachshu/nginx</a>.<br>
<br>
However, there are some places that uses local variable buffer(stack) to recv and send data. To do asynchronous IO, recv and send buffers should be located at safe memory(like heap, data). Therefore it is needed to make these codes to use allocated memory from memory pool when using asynchronous IO.<br>
<br>
Also I am working on improve performance of Nginx for Windows using Registered IO and IOCP.<br>
<br>
diff -r 09dfe4a92414 -r d7420a5777b6 auto/os/linux<br>
--- a/auto/os/linux     Mon Nov 23 11:01:36 2020 +0000<br>
+++ b/auto/os/linux     Mon Nov 23 11:03:35 2020 +0000<br>
@@ -89,6 +89,30 @@<br>
 fi<br>
<br>
<br>
+# io_uring<br>
+<br>
+ngx_feature="uring"<br>
+ngx_feature_name="NGX_HAVE_URING"<br>
+ngx_feature_run=yes<br>
+ngx_feature_incs="#include <liburing.h>"<br>
+ngx_feature_path="-I src/liburing/src/include/"<br>
+ngx_feature_libs="-L src/liburing/src/ -luring"<br>
+ngx_feature_test="struct io_uring          ring;<br>
+                  struct io_uring_params   params;<br>
+                  if (io_uring_queue_init_params(32768, &ring, &params) < 0) return 1;<br>
+                  if (!(params.features & IORING_FEAT_FAST_POLL)) return 1;"<br>
+. auto/feature<br>
+<br>
+if [ $ngx_found = yes ]; then<br>
+    have=NGX_HAVE_CLEAR_EVENT . auto/have<br>
+    CORE_SRCS="$CORE_SRCS $URING_SRCS"<br>
+    CORE_INCS="$CORE_INCS $ngx_feature_path"<br>
+    CORE_LIBS="$CORE_LIBS $ngx_feature_libs"<br>
+    EVENT_MODULES="$EVENT_MODULES $URING_MODULE"<br>
+    EVENT_FOUND=YES<br>
+fi<br>
+<br>
+<br>
 # O_PATH and AT_EMPTY_PATH were introduced in 2.6.39, glibc 2.14<br>
<br>
 ngx_feature="O_PATH"<br>
diff -r 09dfe4a92414 -r d7420a5777b6 auto/sources<br>
--- a/auto/sources      Mon Nov 23 11:01:36 2020 +0000<br>
+++ b/auto/sources      Mon Nov 23 11:03:35 2020 +0000<br>
@@ -120,6 +120,9 @@<br>
 EPOLL_MODULE=ngx_epoll_module<br>
 EPOLL_SRCS=src/event/modules/ngx_epoll_module.c<br>
<br>
+URING_MODULE=ngx_uring_module<br>
+URING_SRCS=src/event/modules/ngx_uring_module.c<br>
+<br>
 IOCP_MODULE=ngx_iocp_module<br>
 IOCP_SRCS=src/event/modules/ngx_iocp_module.c<br>
<br></blockquote></div></div></div><div><div class="gmail_quote"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)">
_______________________________________________<br>
nginx-devel mailing list<br>
<a href="mailto:nginx-devel@nginx.org" target="_blank">nginx-devel@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx-devel" rel="noreferrer" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx-devel</a></blockquote></div>
_______________________________________________<br>
nginx-devel mailing list<br>
<a href="mailto:nginx-devel@nginx.org" target="_blank">nginx-devel@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx-devel" rel="noreferrer" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx-devel</a></div></div>
</blockquote></div></div>
</div>