Opened 11 years ago
Closed 11 years ago
#453 closed defect (fixed)
Modules are initialized twice in single-process mode for Win32
Reported by: | Kroward 1 | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | nginx-core | Version: | |
Keywords: | Cc: | ||
uname -a: | Microsoft Windows [Version 6.1.7601] | ||
nginx -V: | nginx/1.4.4 (official binary) |
Description
There is feature of nginx to run Nginx as single process with 'master_process off'. Documentation says that this is for debug only, but it is very useful in Windows. In windows only one worker is possible, so using this option is acceptable I think.
Actually setting 'master_process off' solve the problem with shared memory on Windows 7+, and enables to use modules like 'limit_conn' which rely on shared pool. (Why this problem with shared memory exist at all if we run single process?)
The only problem that 'win32/ngx_process_cycle.c' initializes modules twice in this mode, one time in procedure ngx_single_process_cycle() and second time in ngx_worker_thread().
Because of this open file descriptors become doubled and select() fires messages to log:
[alert] 2780_2832: select ready != events: 1:2
Removing module initialization loop in ngx_single_process_cycle() fixes this issue.
P.S.: I am aware that running Nginx in Windows is bad, actually I run it on Linux in production ;)
Change History (2)
comment:1 by , 11 years ago
comment:2 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Fix committed, thank you for report.
In b7bf4671bb7b8c455cf54fd39c0f87b7e4fbc312/nginx: