Some Kafka clients don't regularly refresh metadata, causing them not to discover agents within the same Availability Zones (AZs). This can lead to interzone bandwidth usage. Fortunately, Warpstream has introduced a straightforward solution to address this problem using the ClientID features.
The segmentio library, to our knowledge, does not refresh metadata automatically. This behavior is primarily observed in their consumers. However, there have been instances where the producers too stop querying metadata for extended periods. If you're utilizing the segmentio library, it's recommended to activate this feature to minimize interzone network bandwidth consumption.
How to Enable Interzone Load Balancing
To activate the warpstream interzone load balancing in such scenarios, append the following flags to the clientID: warpstream_az=<your-az>,warpstream_interzone_lb=true.
warpstream_az=<your-az>: This flag indicates the AZ in which the client is operating.
warpstream_interzone_lb=true: This flag activates the load balancing mechanism in the agent specifically for this client.
When a client includes the aforementioned flag in the client ID:
The agent periodically assesses if the connection between itself and the client exists within the same AZ. If it does, no action is taken.
If they are in different AZs, the agent checks if there are other agents within the same AZ as the client.
If such agents are found, the agent closes the connection, forcing the client to restart the service discovery process from the beginning, ensuring it identifies agents within its own Availability Zone (AZ).
Tuning the Load Balancing Check Interval
You can adjust the frequency at which the agent verifies this (applicable only to clients who activate the flag in the ClientID) using: