title: NGINX : Exceeds 65535 connections limit
body: <p>Unlike HTTP, websocket keeps a long-live connection after it is upgraded from HTTP.</p>
  
  <p>Even if the OS is tuned to use all ports, still there are only 65536 ports in total. Is it possible for NGINX to exceed this limit?</p>
  
  <p>A potential solution is <code>SO_REUSEPORT</code>, but it is lacking document -- at least I don't find except this following paragraph</p>
  
  <blockquote>
    <p>NGINX release 1.9.1 introduces a new feature that enables use of the
    SO_REUSEPORT socket option, which is available in newer versions of
    many operating systems, including DragonFly BSD and Linux (kernel
    version 3.9 and later). This socket option allows multiple sockets to
    listen on the same IP address and port combination. The kernel then
    load balances incoming connections across the sockets.</p>
  </blockquote>
  
  <p>So, NGINX calls <a href="http://mdoc.su/f/accept.2" rel="nofollow"><code>accept</code></a> to accept an inbound connection.</p>
  
  <blockquote>
    <p>The accept() system call is used with connection-based socket types
    (SOCK_STREAM, SOCK_SEQPACKET). It extracts the first connection
    request on the queue of pending connections for the listening socket,
    sockfd, creates a new connected socket, and returns a new file
    descriptor referring to that socket. The newly created socket is not
    in the listening state. The original socket sockfd is unaffected by
    this call.</p>
  </blockquote>
  
  <p>Will the new socket consume port? If yes, how to exceeds 65535 connections limit?</p>