hazelcast/hazelcast-python-client

[TRACKING ISSUE] TPC default to 1 connection

hz-devops-test opened this issue · 0 comments

The tracking issue for the Java side PR.

See hazelcast/hazelcast#25871 for details.


Before this PR, when a TPC aware client connects to a TPC enabled server, the server sends the list of TPC ports it can connect to. So if the server has 64 TPC threads, it will open 64 server sockets and the client will make 64 connections.

The problem is that having many connections, leads to smaller and more packets which causes additional processing overhead and can run into packets per seconds limits (e.g. on AWS). And the performance penalty of the PPS limit is a lot higher than the penalty of context switching.

This PR changes that. By default, a client will now connect to 1 random port from the TPC port list. The Hazelcast member will then route the request to the right core (the same as with classic networking). The number of ports can be configured through the ClientTpcConfig object and one can restore the behavior of connecting to all TPC ports or a subset.