Skip to content

ClickHouse closing pooled connections #2332

@dizider

Description

@dizider

Hi,
I'm struggling with HTTP connection pooling. I would like to reuse ClickHouse connections for multiple insert queries. I set the following client settings (related with pooling):

.enableConnectionPool(true)
.setSocketKeepAlive(true)
.setSocketTimeout(10, ChronoUnit.MINUTES)

Sometimes the duration between insert queries is few minutes, but the socket is closed after 30 seconds of inactivity by ClickHouse server due to timeout : ServerErrorHandler: Code: 209. DB::NetException: Timeout exceeded while reading from socket (peer: <ip>:49278, local: <ip>:8123, 30000 ms).

Is there something I missed, or misconfigured? Or is there any way to set larger socket keep alive timeout while creating the connection that ClickHouse will respect?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions