You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by GitBox <gi...@apache.org> on 2019/12/30 03:31:20 UTC

[GitHub] [incubator-brpc] pexeer opened a new issue #1007: Hash collision degrades the performance of SocketMap

pexeer opened a new issue #1007: Hash collision degrades the performance of SocketMap
URL: https://github.com/apache/incubator-brpc/issues/1007
 
 
   **Describe the bug (描述bug)**
   send lots of RPC to many server(with same port) will cause high cpu and bad latency. 
   
   **To Reproduce (复现方法)**
   1. use channel with `single` options and  set defer_close_second to 60 seconds.
   2. send every RPC with a new channel object and deconstruct after used. 
   3. startup a large number of server with different ip and same port.
   4. startup a BRPC client and use some thread to send large number of RPC to different server at the same time.
   5. high cpu usage and very high RPC latency in the client.
   
   **Expected behavior (期望行为)**
   Client latency is approximately the same as server-side latency, and normal cpu usage.
   
   **Additional context/screenshots (更多上下文/截图)**
   
   The main point maybe is the Hash function of EndPoint class.
   The hash function `butil::HashPair(uint32_t ip,uint32_t port)` just  connect two uint32_t to  a uint64_t.
   FlatMap used power rehash policy but not the prime rehash policy to speed up `%` operation.
   So only low address of the hash value  will be used by FlatMap.
   Total EndPoint with same port will linked by linked list in the same bucket of FlatMap.
   Lookup EndPoint in the SocketMap is O(n) time complexity guard by a pthread mutex.
   All Channel init will wait the mutex of SocketMap.
   
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] pexeer commented on issue #1007: Hash collision degrades the performance of SocketMap

Posted by GitBox <gi...@apache.org>.
pexeer commented on issue #1007: Hash collision degrades the performance of SocketMap
URL: https://github.com/apache/incubator-brpc/issues/1007#issuecomment-573570828
 
 
   #1008 fixed

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] pexeer closed issue #1007: Hash collision degrades the performance of SocketMap

Posted by GitBox <gi...@apache.org>.
pexeer closed issue #1007: Hash collision degrades the performance of SocketMap
URL: https://github.com/apache/incubator-brpc/issues/1007
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] pexeer edited a comment on issue #1007: Hash collision degrades the performance of SocketMap

Posted by GitBox <gi...@apache.org>.
pexeer edited a comment on issue #1007: Hash collision degrades the performance of SocketMap
URL: https://github.com/apache/incubator-brpc/issues/1007#issuecomment-573570828
 
 
   #1009  fixed

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org