diff mbox

[3/5] package/nginx: add thread pool support

Message ID 1462132345-28253-3-git-send-email-martin@barkynet.com
State Superseded
Headers show

Commit Message

Martin Bark May 1, 2016, 7:52 p.m. UTC
Signed-off-by: Martin Bark <martin@barkynet.com>
---
 package/nginx/Config.in | 3 +++
 package/nginx/nginx.mk  | 3 ++-
 2 files changed, 5 insertions(+), 1 deletion(-)

Comments

Thomas Petazzoni May 1, 2016, 9:42 p.m. UTC | #1
Hello,

On Sun,  1 May 2016 20:52:23 +0100, Martin Bark wrote:

>  NGINX_CONF_OPTS += \
> -	$(if $(BR2_PACKAGE_NGINX_FILE_AIO),--with-file-aio)
> +	$(if $(BR2_PACKAGE_NGINX_FILE_AIO),--with-file-aio) \
> +	$(if $(BR2_PACKAGE_NGINX_THREADS),--with-threads)

Just curious, any reason to not enable this as soon as
BR2_TOOLCHAIN_HAS_THREADS=y ?

Thomas
Martin Bark May 3, 2016, 8:54 a.m. UTC | #2
Thomas,

On 1 May 2016 at 22:42, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Hello,
>
> On Sun,  1 May 2016 20:52:23 +0100, Martin Bark wrote:
>
>>  NGINX_CONF_OPTS += \
>> -     $(if $(BR2_PACKAGE_NGINX_FILE_AIO),--with-file-aio)
>> +     $(if $(BR2_PACKAGE_NGINX_FILE_AIO),--with-file-aio) \
>> +     $(if $(BR2_PACKAGE_NGINX_THREADS),--with-threads)
>
> Just curious, any reason to not enable this as soon as
> BR2_TOOLCHAIN_HAS_THREADS=y ?

Well it does add code so if you just want nginx as a static webserver
on an embedded device you probably don't need this.  Just for interest
there is some info on nginx thread pools here
https://www.nginx.com/blog/thread-pools-boost-performance-9x/.  I
really just added the option for completeness.

What is missing is a dependency on BR2_TOOLCHAIN_HAS_THREADS for
BR2_PACKAGE_NGINX_THREADS in the Config.in so I'll resubmit with that
fixed.

Thanks

Martin

>
> Thomas
> --
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com
diff mbox

Patch

diff --git a/package/nginx/Config.in b/package/nginx/Config.in
index f925cc7..bec83c3 100644
--- a/package/nginx/Config.in
+++ b/package/nginx/Config.in
@@ -18,6 +18,9 @@  config BR2_PACKAGE_NGINX_FILE_AIO
 	depends on !BR2_aarch64
 	depends on !BR2_arc
 
+config BR2_PACKAGE_NGINX_THREADS
+    bool "thread pool support"
+
 config BR2_PACKAGE_NGINX_HTTP
 	bool "http server"
 	default y
diff --git a/package/nginx/nginx.mk b/package/nginx/nginx.mk
index 7f3b075..91772b3 100644
--- a/package/nginx/nginx.mk
+++ b/package/nginx/nginx.mk
@@ -64,7 +64,8 @@  NGINX_CONF_OPTS += \
 	--http-uwsgi-temp-path=/var/tmp/nginx/uwsgi
 
 NGINX_CONF_OPTS += \
-	$(if $(BR2_PACKAGE_NGINX_FILE_AIO),--with-file-aio)
+	$(if $(BR2_PACKAGE_NGINX_FILE_AIO),--with-file-aio) \
+	$(if $(BR2_PACKAGE_NGINX_THREADS),--with-threads)
 
 ifeq ($(BR2_PACKAGE_PCRE),y)
 NGINX_DEPENDENCIES += pcre