Skip navigation

Twins Father

December 28, 2010 Previous day Next day

Do you here about C10K?

 

C10K normally means how to create 10K connections between client and sever via tcp protocol. Have you ever tried two socket client program creating more than 10K connections with single socket sever program?

 

So in Windows 2003, you will say 2 socket client program can only create 5K connections with 1 socket server program  as Windows 2003 default max_user_port is 5000.

 

So in Windows 2008, you will say 2 socket client program can only create with 15K connections with 1 socket server program as Windows 2008 default max_user_port is 15000.

 

But I will say you are wrong totally, do you remember the definition for Ephemeral Port?

 

So the terminology of ephemeral port is mainly used for the socket programming. So (client_ip, client_port, server_ip, server_port) which is ephemeral port actually, the answer is client_port.

 

So this time can you repeat answer the question above:

 

So in Windows 2003, you will say 2 socket client program can  create 10K connections with 1 socket server program  as Windows 2003  default max_user_port is 5000.

 

So in Windows 2008, you will say 2 socket client program can only create with 30K connections with 1 socket server program as Windows 2008 default max_user_port is 15000.

 

Then you will find out the max_user_port actually definied the times client can connection with the same server service (server_ip, server_port).

 

Recently I do test with Netty project with their echo examples,

1. One server machine start with Server Program.

2. Client occupied 3 machines * each machine started 4 jvm instances = 12 jvm instances and each instances will send out 2K connections.  So totally we got 24K connections at the end.

 

Note:

1. all of them based on Windows 2008, the jdk is 1.6_21.

2. The client.bat you need change the parameter with your <sever host address> <server port:8080> <initialMessageSize:256>

 

 

It's dummy only can view the connection be connected. But that already give you the ideas how can we implement C10K currently.

 

Next I will try my best fullfill more functions and try C500K ! Please wait for that post later.

Filter Blog

By date:
By tag: