clickhouse-java icon indicating copy to clipboard operation
clickhouse-java copied to clipboard

Slow Query Performance with 100 Threads

Open BorisPengili opened this issue 2 years ago • 1 comments

Describe the bug

I have using clickhouse-http-client 0.4.5 and I am executing single query where retrieve all records from the 'table' where the primary key is equal to a specific value something like this: "Select * from table where primary_key = ''". When I run with single threads, the perfomance is around than 30 ms. When I run with 50 threads, the perfomance is around 200-500 ms. When I run with 100 threads, the perfomance is around 1 seconds

When I run this command multiple times, I can not see that httpConnection is more than 16 connection image

Expected behaviour

I am expecting that even with 100 threads the query should be less than 100 ms

Code example

image image

Error log

Configuration

Environment

  • Client version:clickhouse-http-client 0.4.5
  • Language version: Java 8
  • OS: linux

ClickHouse server

  • ClickHouse Server version:23.1.3.5
  • ClickHouse Server non-default settings, if any:
  • CREATE TABLE statements for tables involved:
  • Sample data for all these tables, use clickhouse-obfuscator if necessary

BorisPengili avatar Oct 16 '23 11:10 BorisPengili

@BorisPengili, Hi can you please change to our new version v0.5.0 we are using a different underlying layer (Apache HTTP Client) Another question

  • Is the bottleneck on the ClickHouse server or on the client side
  • Can you provide more details about CPU consumption on both client & server
  • Client and server machine types

mzitnik avatar Oct 22 '23 11:10 mzitnik