ClickHouse / ClickHouse/ch-go

Feature Request: Shared buffer pool for multiple clients

Open
#1,095 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
428
Forks
84
Avg merge
9d 6h
Merged PRs (30d)
4

Description

**Title:** Feature Request: Shared buffer pool for multiple clients

**Body:**
Currently each `chpool.Client` holds a dedicated buffer (\~100 MiB), which causes very high memory usage (10+ GiB) when maintaining many clients for multi-node inserts. It would be helpful to allow a shared buffer pool (e.g. via `sync.Pool` or a custom provider) so buffers can be reused across clients.

**Repro steps:**

```go
for i := 0; i < 20; i++ {
pool, _ := chpool.New(chpool.Options{ /* connect to node[i] */ })
// Each pool allocates its own ~100 MiB buffer
}
```

With dozens of clients, total memory usage grows significantly.

**Expected behavior:**
Provide an option to configure a shared buffer provider so multiple clients can reuse the same pool of buffers, reducing overall memory overhead in multi-node scenarios.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.