From: Miriam P. V. <mir...@gm...> - 2006-04-06 11:38:07
|
Data Channel vs Command Channel. ================================ In serval_distributed_manager we can see this kind of code. This is frecuently repeated in connection_operation and many other processes both in client and server. handle_cast({send_broadcast_source_to_server,ClientId,MessageData,Timestamp},State) -> .... handle_cast({send_unicast_source_to_server,_ClientId,DestinationAddress,MessageData,Timestamp},State) ... handle_cast({authenticate_plain_request,UserLogin,UserPassword},State) -> ... handle_cast({join_vlan_request, VlanId}, State) -> ... handle_cast({create_vlan_request,VlanId,Description,GroupList}, State) -> .. handle_cast(vlans_list_request, State) -> ... handle_cast({leave_vlan_request, VlanId}, State) -> [..many others..] Erlang's daddy says we can not assume that ordering the pattern-matching will make the first be evaluated before the other ones. So, even if this computation time is quite short, if you think of the amount of data messages that serval is proccesing every second (160 packets sec in internet???), it could be a big amount of useless effort. One of the most important tips on improving the performance of Serval server is to sepparate this channels. Data and control. >From my point of view, the best way to implement this separation is having the data channel in a port and the command channel in another different. So there will be no code to sepparate this messages in the server,thus deleting a lot of computation. I haven't thought about it yet, but with this separation it could be necessarie to develop new processes in the server for each client. If we assume we have to implement the "obervers design pattern" i will talk in another mail, command channel will encrease with big amount of computation that shall not be mixed with data's one. What do you think about this? |