-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dekaf: Track and report additional metrics, and improve connection st…
…ability/freshness I observed some concerning behavior when switching `dekaf.estuary.dev` to advertise `dekaf.estuary-data.com`, namely all API requests to the upstream MSK broker were returning with error codes. A restart of Dekaf "fixed" the problem, and I ended up realizing that those connections were probably sitting open and idle for days. The theory is that even though we set TCP keepalive, the connections had gotten into a bad state. So I introduced a couple different mitigations: * All idle connections (that is, connections that were opened but have since been returned to the pool) get closed after a short period of time (60s in this case) * All idle connections that were opened over 30m ago get closed. The stateless usage pattern of connections should mean that this results in no connection lasting longer than roughly 30m. * A connection is "exercised" every time it's returned to the pool to check whether it's still open and able to communicate with the broker. New metrics: * `pool_size` (by broker): The number of connections open to this broker * `pool_available` (by broker): The number of open, free connections available for use * `pool_waiting` (by broker): The number of requests blocked waiting for a connection to become available * `pool_connection_avg_age` (by broker): the average age of a pool connection to this broker * `pool_connection_avg_idle` (by broker): the average time a connection to this broker has been idle * `api_call_time` (by api method): A histogram of the time it takes to serve a kafka protocol request
- Loading branch information
Showing
6 changed files
with
92 additions
and
32 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.