Skip to content

Nginx AIO threads for Concurrent Request

Taymindis Woon edited this page May 30, 2018 · 12 revisions

nginx-C-function with AIO threads request feature (only applicable with version 1.13.4 and above)

sometimes the a worker process the heavy app request might slow down the performance due to synchronize process.

enable the multithreading 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;
        }
    }
}

Now your app can accept more than one request from client, enjoy :)

Clone this wiki locally