You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Evgeny Kotkov <ev...@visualsvn.com> on 2017/07/11 14:22:39 UTC

[PATCH] Allow larger apr_socket_listen() backlog queue lengths on Windows 8+

Hi everyone,

Starting with Windows 8, the socket listen() function accepts a special
SOMAXCONN_HINT(N) argument that allows making the backlog queue
length larger than the otherwise predefined limit of around 200:

  https://msdn.microsoft.com/en-us/library/windows/desktop/ms739168
  https://blogs.msdn.microsoft.com/winsdk/2015/06/01/winsocks-listen-backlog-offers-more-flexibility-in-windows-8/

Having a larger listen backlog can be used for certain high performance
applications that need to handle lots of incoming connections.  One
example would be the httpd server with it's "ListenBacklog" directive
where setting it to a larger value currently allows serving more concurrent
connections on Windows with mpm_winnt.

The attached patch starts using SOMAXCONN_HINT() in the Win32
implementation of the apr_socket_listen() function if this feature is
supported by the underlying version of Windows.

The log message is included in the beginning of the patch file.


Regards,
Evgeny Kotkov

Re: [PATCH] Allow larger apr_socket_listen() backlog queue lengths on Windows 8+

Posted by Ivan Zhakov <iv...@visualsvn.com>.
On 12 July 2017 at 01:37, Evgeny Kotkov <ev...@visualsvn.com> wrote:
> Evgeny Kotkov <ev...@visualsvn.com> writes:
>
>> The attached patch starts using SOMAXCONN_HINT() in the Win32
>> implementation of the apr_socket_listen() function if this feature is
>> supported by the underlying version of Windows.
>
> With a bit more thought on this, here is the V2 version of this patch that
> doesn't require having a new Windows SDK to get the new behavior.
>
> This is achieved by optionally borrowing the definition of SOMAXCONN_HINT()
> from an appropriate version of the SDK.
>
>
Committed in r1805309. Thanks!



-- 
Ivan Zhakov

Re: [PATCH] Allow larger apr_socket_listen() backlog queue lengths on Windows 8+

Posted by Evgeny Kotkov <ev...@visualsvn.com>.
Evgeny Kotkov <ev...@visualsvn.com> writes:

> The attached patch starts using SOMAXCONN_HINT() in the Win32
> implementation of the apr_socket_listen() function if this feature is
> supported by the underlying version of Windows.

With a bit more thought on this, here is the V2 version of this patch that
doesn't require having a new Windows SDK to get the new behavior.

This is achieved by optionally borrowing the definition of SOMAXCONN_HINT()
from an appropriate version of the SDK.


Regards,
Evgeny Kotkov