Sponsor:

Server and Web Integrator
Link:
Kloxo-MR logo
6.5.0 or 7.0.0
Click for "How to install"
Donation/Sponsorship:
Kloxo-MR is open-source.
Donate and or Sponsorship always welcome.
Click to:
Click Here
Please login or register. 2024-04-28, 20:50:47

Author Topic: Enable multi-threading in nginx  (Read 7163 times)

0 Members and 1 Guest are viewing this topic.

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
Enable multi-threading in nginx
« on: 2015-05-03, 17:18:47 »
http://nginx.org/en/docs/http/ngx_http_core_module.html#aio

Very useful feature which will reduce load ;)

Quote
By default, multi-threading is disabled, it should be enabled with the --with-threads configuration parameter. Currently, multi-threading is compatible only with the epoll, kqueue, and eventport methods. Multi-threaded sending of files is only supported on Linux.

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Enable multi-threading in nginx
« Reply #1 on: 2015-05-03, 18:45:34 »
I am not compile nginx but using nginx from nginx.org directly. Don't know they enable or disable it.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline djscooby

  • Valuable Member
  • *
  • Posts: 119
  • Karma: +0/-0
    • View Profile
Re: Enable multi-threading in nginx
« Reply #2 on: 2015-05-05, 19:09:40 »
@spacedust great idea indeed i was thinking the same these days but how to compile it ? Any idea if it will be compatible with kloxo MR 7 ???

@MR i dont beleive its compiled default from nginx org.. By checking nginx -V doesnt seem to include it:
Code: [Select]
nginx version: nginx/1.9.0
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC)
built with OpenSSL 1.0.1e-fips 11 Feb 2013
TLS SNI support enabled
configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-http_auth_request_module --with-threads --with-stream --with-stream_ssl_module --with-mail --with-mail_ssl_module --with-file-aio --with-ipv6 --with-http_spdy_module --with-cc-opt='-O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic'

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
Re: Enable multi-threading in nginx
« Reply #3 on: 2015-05-05, 19:24:00 »
@spacedust great idea indeed i was thinking the same these days but how to compile it ? Any idea if it will be compatible with kloxo MR 7 ???

@MR i dont beleive its compiled default from nginx org.. By checking nginx -V doesnt seem to include it:
Code: [Select]
nginx version: nginx/1.9.0
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC)
built with OpenSSL 1.0.1e-fips 11 Feb 2013
TLS SNI support enabled
configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-http_auth_request_module --with-threads --with-stream --with-stream_ssl_module --with-mail --with-mail_ssl_module --with-file-aio --with-ipv6 --with-http_spdy_module --with-cc-opt='-O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic'

So we just need to add some config params.

Offline djscooby

  • Valuable Member
  • *
  • Posts: 119
  • Karma: +0/-0
    • View Profile
Re: Enable multi-threading in nginx
« Reply #4 on: 2015-05-05, 19:35:45 »
@spacedust but its not installed as it seems ..

look here nginx mod_pagespeed enabled
Code: [Select]
nginx -V
nginx version: nginx/1.4.4
TLS SNI support enabled
configure arguments: --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf
--error-log-path=/var/log/nginx/error.log --http-client-body-temp-path=/var/lib/nginx/body
--http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-log-path=/var/log/nginx/access.log
--http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi
--http-uwsgi-temp-path=/var/lib/nginx/uwsgi --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid
--with-pcre-jit
--with-debug --with-http_addition_module --with-http_dav_module --with-http_geoip_module
--with-http_gzip_static_module --with-http_image_filter_module
--with-http_realip_module
--with-http_stub_status_module --with-http_ssl_module
--with-http_sub_module --with-http_xslt_module
--with-ipv6 --with-mail --with-mail_ssl_module
--add-module=/root/custom-nginx-1.4.4/nginx-1.4.4/debian/modules/nginx-upload-progress
--add-module=/root/custom-nginx-1.4.4/nginx-1.4.4/debian/modules/nginx-auth-pam
--add-module=/root/custom-nginx-1.4.4/nginx-1.4.4/debian/modules/nginx-dav-ext-module
--add-module=/root/custom-nginx-1.4.4/nginx-1.4.4/debian/modules/nginx-echo
--add-module=/root/custom-nginx-1.4.4/nginx-1.4.4/debian/modules/nginx-upstream-fair
--add-module=/root/custom-nginx-1.4.4/nginx-1.4.4/debian/modules/ngx_http_substitutions_filter_module
--add-module=/root/custom-nginx-1.4.4/nginx-1.4.4/debian/modules/ngx_pagespeed-1.7.30.1-beta

its not just the config params it needs compile from start

look here : https://www.digitalocean.com/community/tutorials/how-to-add-ngx_pagespeed-module-to-nginx-in-debian-wheezy

and here : https://www.rosehosting.com/blog/speed-up-nginx-using-ngx_pagespeed-on-a-centos-6-vps/

for ideas..

i dont know if nginx custom compiled is compatible with kloxo mr 7 configs
« Last Edit: 2015-05-05, 19:41:20 by djscooby »

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Enable multi-threading in nginx
« Reply #5 on: 2015-05-05, 19:45:04 »
You can try tengine (nginx fork from taobao) with 'yum replace nginx --replace-with=tengine'.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline djscooby

  • Valuable Member
  • *
  • Posts: 119
  • Karma: +0/-0
    • View Profile
Re: Enable multi-threading in nginx
« Reply #6 on: 2015-05-05, 20:11:11 »
@spacedust @mr sorry guys i thought you were talking from mod_pagespeed for nginx my mistake...

@mr have you ever tested compile nginx from scratch and use it inside kloxo mr7 ? will it work with your custom configs ?

i will test next weeks tengine on a development vps and i will let you know but i beleive modpagespeed will be great if enabled for nginx..

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Enable multi-threading in nginx
« Reply #7 on: 2015-05-05, 20:36:03 »
I will not install nginx but tengine. The reason is with tengine possible compile 'external' modules (external mean compile module without recompile main programs or embed new modules to main programs).
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
Re: Enable multi-threading in nginx
« Reply #8 on: 2015-05-06, 13:48:59 »
I will not install nginx but tengine. The reason is with tengine possible compile 'external' modules (external mean compile module without recompile main programs or embed new modules to main programs).

Good - just add it to your repo as a replacement for nginx.

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Enable multi-threading in nginx
« Reply #9 on: 2015-05-06, 14:11:45 »
For using tengine just running 'yum replace nginx --replace-with=tengine'.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

 


Top 4 Global Search Engines:    Google    Bing    Baidu    Yahoo
Click Here

Page created in 0.076 seconds with 19 queries.

web stats analysis