Skip to content

Implement Executor Level Connection Pool for NodeClient #469

@ShimonSte

Description

@ShimonSte

Currently, each partition task creates its own NodeClient instance, resulting in one ClickHouse connection per partition. When an executor processes multiple partitions (common scenario), this leads to unnecessary connection overhead.

Example:

  • 1000 partitions distributed across 10 executors
  • Each executor processes ~100 partitions
  • Current: 1000 connections created (100 per executor)
  • Optimal: 10 connections (1 per executor, shared across partitions)

Current Implementation

// ClickHouseReader.scala
private lazy val nodesClient = NodesClient(part.candidateNodes)
def nodeClient: NodeClient = nodesClient.node

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions