Why the info 'A worker can handle no more than 1024 simultaneous

M
  • 16 Nov '22
Hello,

Previous we could find this very important information on the "nginx for Windows" page ( http://nginx.org/en/docs/windows.html ) :

Known issues
...
A worker can handle no more than 1024 simultaneous connections.
...

Why has it been removed ?
I struggled a lot understanding why increasing worker_connections above 1024 was not working on Windows.

I had to search forums to find this crucial information that existed previously on the page.

Ex:

https://serverfault.com/questions/616281/nginxphp-scalability-on-windows

https://www.ruby-forum.com/t/nginx-window-native/214687

https://forum.nginx.org/read.php?2,188714,188714

https://forum.nginx.org/read.php?2,258259,258261

You can see that the content of the "Know issues" paragraph that existed at the time was quoted and that it included the sentence.

Strangely it is still included here :
https://www.cnginx.com/docs/windows.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20221116/06cc4d05/attachment.htm>
M
  • 16 Nov '22
Hello!

On Wed, Nov 16, 2022 at 03:31:14PM +0000, Masseau Olivier via nginx wrote:

> Previous we could find this very important information on the 
> "nginx for Windows" page ( http://nginx.org/en/docs/windows.html 
> ) :
> 
> Known issues
> ...
> A worker can handle no more than 1024 simultaneous connections.
> ...
> 
> Why has it been removed ?
> I struggled a lot understanding why increasing 
> worker_connections above 1024 was not working on Windows.

As you can see from the source code repository of the nginx.org 
site, the relevant item was removed along with the documentation 
of the poll event method being supported on Windows (introduced in 
nginx 1.15.9):

http://hg.nginx.org/nginx.org/rev/4795c2ae5066
Added the "poll" method for Windows.

With the poll event method, as long as it is supported by the 
Windows version you are using (Windows Vista or later), nginx will 
use the WSAPoll() function, which, in contrast to select(), does 
not impose a hard-coded limit on the number of connections.  
You'll have to use the "use poll;" in your configuration to 
instruct nginx to use the poll event method, see 
http://nginx.org/r/use for details.

Note though that with poll there might be other issues, such as 
failure to report connect() errors till the timeout expires (see 
https://daniel.haxx.se/blog/2012/10/10/wsapoll-is-broken/ for 
details; shouldn't be a major issue in case of nginx though, since 
errors while connecting to backend servers aren't expected to 
happen).

Also note that Windows isn't really designed as an efficient 
server platform, and nginx is not really designed to work on 
Windows.  Running nginx on Windows in production setups might not 
be a good idea.

Hope this helps.

-- 
Maxim Dounin
http://mdounin.ru/
M
  • 17 Nov '22
Thanks ;)

Maybe it would be nice to add this info on the http://nginx.org/en/docs/windows.html  page.
Because without your answer I think I would never have been able to find this information :)

I'm aware that Nginx is not a good idea in production.
But I was asked to evaluate and give evidence from which point the  "not so good idead" starts to become a "really really bad idead" :p

========

Hello!

On Wed, Nov 16, 2022 at 03:31:14PM +0000, Masseau Olivier via nginx wrote:

> Previous we could find this very important information on the "nginx 
> for Windows" page ( http://nginx.org/en/docs/windows.html
> ) :
>
> Known issues
> ...
> A worker can handle no more than 1024 simultaneous connections.
> ...
>
> Why has it been removed ?
> I struggled a lot understanding why increasing worker_connections 
> above 1024 was not working on Windows.

As you can see from the source code repository of the nginx.org site, the relevant item was removed along with the documentation of the poll event method being supported on Windows (introduced in nginx 1.15.9):

http://hg.nginx.org/nginx.org/rev/4795c2ae5066
Added the "poll" method for Windows.

With the poll event method, as long as it is supported by the Windows version you are using (Windows Vista or later), nginx will use the WSAPoll() function, which, in contrast to select(), does not impose a hard-coded limit on the number of connections.
You'll have to use the "use poll;" in your configuration to instruct nginx to use the poll event method, see http://nginx.org/r/use for details.

Note though that with poll there might be other issues, such as failure to report connect() errors till the timeout expires (see https://daniel.haxx.se/blog/2012/10/10/wsapoll-is-broken/ for details; shouldn't be a major issue in case of nginx though, since errors while connecting to backend servers aren't expected to happen).

Also note that Windows isn't really designed as an efficient server platform, and nginx is not really designed to work on Windows.  Running nginx on Windows in production setups might not be a good idea.

Hope this helps.

--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
nginx mailing list -- nginx at nginx.org
To unsubscribe send an email to nginx-leave at nginx.org
M
  • 17 Nov '22
Hello!

On Thu, Nov 17, 2022 at 04:06:37PM +0000, Masseau Olivier via nginx wrote:

> Maybe it would be nice to add this info on the 
> http://nginx.org/en/docs/windows.html  page.
> Because without your answer I think I would never have been able 
> to find this information :)

The page in question doesn't try to document how to configure 
nginx on Windows for various production setups.  Rather, it tries to 
document that such setups are not really supported and should be 
avoided.

> I'm aware that Nginx is not a good idea in production.
> But I was asked to evaluate and give evidence from which point 
> the  "not so good idead" starts to become a "really really bad 
> idead" :p

Certainly nginx is production is a good idea, just not on Windows.  
Expect nginx on Windows to be usable for tasks like testing and 
development, but not for production.  For production setups, 
consider switching to a Unix-like OS.

-- 
Maxim Dounin
http://mdounin.ru/
M
  • 18 Nov '22
Yes I meant nginx on windows sorry.

====

Hello!

On Thu, Nov 17, 2022 at 04:06:37PM +0000, Masseau Olivier via nginx wrote:

> Maybe it would be nice to add this info on the 
> http://nginx.org/en/docs/windows.html  page.
> Because without your answer I think I would never have been able to 
> find this information :)

The page in question doesn't try to document how to configure nginx on Windows for various production setups.  Rather, it tries to document that such setups are not really supported and should be avoided.

> I'm aware that Nginx is not a good idea in production.
> But I was asked to evaluate and give evidence from which point the  
> "not so good idea" starts to become a "really really bad idea" :p

Certainly nginx is production is a good idea, just not on Windows.
Expect nginx on Windows to be usable for tasks like testing and development, but not for production.  For production setups, consider switching to a Unix-like OS.

--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
nginx mailing list -- nginx at nginx.org
To unsubscribe send an email to nginx-leave at nginx.org