How many TCP sockets can I open at once?

I am going to develop a tcp server application. I am on the "choose server" step. My tcp server will have 2000+ clients and one socket for each client.

So my question is: is there a restriction for creating a socket depending on the operating system?

which operating system allows more sockets at a time?

Thanks in advance,

+3
source share
2 answers

, , , ( - , , - , , , . @corsiKa , .)

:

# Shows some general useful information,
ulimit -a

# if not, here are some other places to look
# maximum files:
cat /proc/sys/fs/file-max  

# maximum filedescriptors:
cat /proc/sys/fs/file-nr  

# maximum backlog of unaccepted clients:
cat /proc/sys/net/core/somaxconn

# And number of threads to run at once:
cat /proc/sys/kernel/threads-max

You->Them , , , , :

sysctl net.ipv4.ip_local_port_range

"" , , , :

sysctl net.ipv4.tcp_max_syn_backlog
sysctl net.core.netdev_max_backlog

: tcp/ip Linux

+5

A 2Gb Windows 16 000 - , 2Gb :

Windows NT, Windows 2000, Windows XP Windows 2003 Server , , , , - 1/8- , 128 Windows NT 256 Windows 2000 . Windows NT 12 000 25 000 Windows 2000 . , , Windows Server 4000 512 . Windows NT , 8000 1 . Windows 2000 16 000 2 .

BSD 1 , 2 :

, , . , 1 tcp ( , !)

$netstat -an | grep -c EST

1016313

, - 10 ^ 5 10 ^ 7 , ish.

+5

All Articles