Skip to content

Conversation

@iuwqyir
Copy link
Contributor

@iuwqyir iuwqyir commented Apr 9, 2025

TL;DR

Added support for configuring the maximum number of open connections to Clickhouse.

What changed?

  • Added a new MaxOpenConns field to the ClickhouseConfig struct in configs/config.go
  • Modified the Clickhouse connection setup in internal/storage/clickhouse.go to use the configured MaxOpenConns value when it's greater than 0

How to test?

  1. Set the maxOpenConns parameter in your Clickhouse configuration
  2. Verify that the connection pool respects this limit under load
  3. Monitor Clickhouse server connection metrics to confirm the limit is enforced

Why make this change?

This change allows for better control over connection pooling to Clickhouse, which can help prevent connection exhaustion under high load. By limiting the maximum number of open connections, we can ensure the application doesn't overwhelm the database server with too many concurrent connections, improving stability and resource utilization.

Copy link
Contributor Author

iuwqyir commented Apr 9, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@iuwqyir iuwqyir marked this pull request as ready for review April 9, 2025 10:03
@iuwqyir iuwqyir closed this Apr 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants