-
Notifications
You must be signed in to change notification settings - Fork 43
Nginx AIO threads for Concurrent Request
Taymindis Woon edited this page Sep 22, 2018
·
12 revisions
sometimes one worker only can process one request per time, what if process the heavy app request might slow down the performance due to synchronize process.
Resolution:- enable the multi threading request, just recompile your nginx by using --with-threads.
After installed, enable the multithread in your server block
http {
server {
listen 8080;
aio threads;
ngx_http_c_func_link_lib "/etc/nginx/apps/libcfuntest.so";
location /callme {
ngx_http_c_func_call "my_app_simple_get_greeting";
# ngx_http_c_func_call "my_app_simple_get_greeting" respTo=myRespVariable;
# return 200 $myRespVariable;
}
}
}
Compilation References: https://www.nginx.com/blog/thread-pools-boost-performance-9x/