thread_pool in Windows

Ruslan Ermilov ru at nginx.com
Wed Mar 7 08:22:03 UTC 2018


On Tue, Mar 06, 2018 at 10:38:21PM -0500, Sergey Sandler wrote:
> Thank you, Valentin.
> 
> There is something I am missing. Please see the start of the error.log
> below,
> 
> 2018/03/04 14:05:50 [notice] 5144#9212: using the "select" event method
> 2018/03/04 14:05:50 [notice] 5144#9212: using the "select" event method
> 2018/03/04 14:05:50 [notice] 5144#9212: nginx/1.12.2
> 2018/03/04 14:05:50 [notice] 5144#9212: nginx/1.12.2
> 2018/03/04 14:05:50 [info] 5144#9212: OS: 260200 build:9200, "", suite:300,
> type:1
> 2018/03/04 14:05:50 [notice] 5144#9212: start worker processes
> 2018/03/04 14:05:50 [notice] 5144#9212: start worker processes
> 2018/03/04 14:05:50 [notice] 5144#9212: start worker process 13648
> 2018/03/04 14:05:50 [notice] 5144#9212: start worker process 13648
> 2018/03/04 14:05:51 [notice] 13648#4924: nginx/1.12.2
> 2018/03/04 14:05:51 [notice] 13648#4924: nginx/1.12.2
> 2018/03/04 14:05:51 [info] 13648#4924: OS: 260200 build:9200, "", suite:300,
> type:1
> 2018/03/04 14:05:51 [notice] 13648#4924: create thread 17496
> 2018/03/04 14:05:51 [notice] 13648#4924: create thread 17496
> 2018/03/04 14:05:51 [notice] 13648#4924: create thread 16328
> 2018/03/04 14:05:51 [notice] 13648#4924: create thread 16328
> 2018/03/04 14:05:51 [notice] 13648#4924: create thread 13940
> 2018/03/04 14:05:51 [notice] 13648#4924: create thread 13940
> 
> There is a single process (worker_processes  1 in the nginx.conf), with
> seemingly three threads (not sure why the lines in the log file are
> duplicated). Is the purpose of the additional threads to read static files
> (from the server)?

nginx for Windows only uses one worker process, and inside it only
one worker thread is created.  You see three threads because it also
creates two other threads for cache_manager and cache_loader (these
are implemented as separate processes on UNIX):

    if (ngx_create_thread(&wtid, ngx_worker_thread, NULL, log) != 0) {
        goto failed;
    }

    if (ngx_create_thread(&cmtid, ngx_cache_manager_thread, NULL, log) != 0) {
        goto failed;
    }

    if (ngx_create_thread(&cltid, ngx_cache_loader_thread, NULL, log) != 0) {
        goto failed;
    }


See also:

http://nginx.org/en/docs/windows.html#known_issues (item #1)
http://nginx.org/en/docs/windows.html#possible_future_enhancements (item #3)


More information about the nginx mailing list