Is it more effici开发者_StackOverflow中文版ent for a key-value data store such as Redis to handle X number of requests over 1 client connection or 1 request per client over X number of client connections?
In theory reusing a connection means that less work is required on the connection overhead so it is technically more efficient. However, in practice latency means that using a single connection is dramatically slower with the server being idle most of the time.
Redis performance is almost never limited by the CPU - it can quite easily serve 100 requests on separate connections in the time it would otherwise spend waiting for the second request on a single connection.
精彩评论