What is the upper limit on the number of open sockets I can have in Windows Server 2003

I am creating a chat server with .NET. I tried to open about 2000 client connections, and my Linksys WRT54GL router (with tomato firmware) crashes every time. The same thing happens when I have multiple connections open on my Azureus firewall.

I have three questions:

  • Is there a limit on the number of open sockets I can have in Windows Server 2003?
  • Is a Linksys router a problem? If so, is it recommended to use the recommended equipment?
  • Is there a way to share sockets so that I can handle more open client connections with fewer resources?
+2
source share
4 answers

As I mentioned earlier, Raymond Chen has some good tips on this: if you should ask about OS limitations, you are probably doing something wrong. IP allows a maximum of 65535 ports, and many of them are reserved and not available for general use. I would suggest that your messaging protocols need to be thought out in more detail so that OS limitations are not a problem. I am sure that there are many good resources describing such systems, and there are, of course, people here who would have good ideas about this.

EDIT: I'm going to voice some thoughts on implementing a scalable chat server.

, . (, ), :

create message packet
open port to server
send packet
close port

:

connection request received
get packet
close connection
process packet
for each client that requires updating
  open connection to clients
  send update packet
  close connection

, , , " " IP- . . , , , . , " ". , .

, .

+2
+2

, , :

Windows 2003 , . , MaxUSerPort 5000, , 64k (.).

, , 64 . IP-, , , TCP- IP- . , n x 64k.

+2

Window 7. Win 7, Windows - .

, Windows: http://technet.microsoft.com/en-us/magazine/2007.12.network.aspx

For me, it worked as follows:

  • Open Regedit
    • HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ services \ Tcpip \ Parameters: Create TcpNumConnections, REG_DWORD, decimal value 500 (this can be set according to your needs); EnableConnectionRateLimiting, REG_DWORD, value 0;
    • HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ services \ Tcpip: Create MaxUserPort, REG_DWORD, decimal value 65534
  • Windows reboot
+1
source

Source: https://habr.com/ru/post/1719597/


All Articles