liushidefeng / protobuf-rpc-pro

Automatically exported from code.google.com/p/protobuf-rpc-pro
0 stars 0 forks source link

how to deal with connecton numbers between many server node? #5

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,i am using your product in our team,
our server is some message servers,the server nodes can exchange messages 
between each other by serverid,it has 5 server nodes now,the connection number 
is 20, my question is if it extends to dozen of servers, how can i deal with 
these connections, Or I should use some bus instead, how to gain high 
performance?

appreciate your answer :) thx~

Original issue reported on code.google.com by yingying...@gmail.com on 22 Mar 2012 at 8:21

GoogleCodeExporter commented 9 years ago
so if i understand right, each server is connected to each other server, so 5x4 
connections == 20. Now the question of whether a bus ( multicast ) is 
appropriate or not depends on whether you really intend or need to distribute 
ALL messages between ALL servers ( and a bit on the location of these servers 
). In the end, you will only remain performant if you partition your data 
between available servers to provide a certain amount of redundancy, and 
unicast your data to the few appropriate servers.

There might be a "sweet" spot where multicast ( assuming in a single LAN / 
cloud provider ) is both efficient and fast for a dozen or so servers, but if 
you apply a reliable transport on top of UDP multicast, then you're overall 
sustainable throughput is limited by the message consumption rate of the 
slowest consumer(server).

If you partition your server data and only message to 2 or 3, the the absolute 
number of servers which a single server knows is hardly relavant. You can have 
TCP connections to hundreds of other servers without having problems. You have 
to consider your LAN/WAN setup and network topology to get really high 
performance ( and then you will need to know if you are trying to optimize 
throughput or latency ).

Original comment by pjklauser@gmail.com on 22 Mar 2012 at 7:09

GoogleCodeExporter commented 9 years ago

Original comment by pjklauser@gmail.com on 22 Apr 2012 at 8:14