Skip to content

Instantly share code, notes, and snippets.

@zhicwu
Last active July 26, 2021 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zhicwu/663f28deb3dc44314b5439fadd15082d to your computer and use it in GitHub Desktop.
Save zhicwu/663f28deb3dc44314b5439fadd15082d to your computer and use it in GitHub Desktop.
snapshot
┌─is_initial_query─┬─user────┬─query_id─────────────────────────────┬─address───────────────┬──port─┬─initial_user─┬─initial_query_id─────────────────────┬─initial_address───────┬─initial_port─┬─interface─┬─os_user─┬─client_hostname─┬─client_name─┬─client_revision─┬─client_version_major─┬─client_version_minor─┬─client_version_patch─┬─http_method─┬─http_user_agent─┬─http_referer─┬─forwarded_for─┬─quota_key─┬────────elapsed─┬─is_cancelled─┬─read_rows─┬─read_bytes─┬─total_rows_approx─┬─written_rows─┬─written_bytes─┬─memory_usage─┬─peak_memory_usage─┬─query─────────────────────────────┬─thread_ids─┬─ProfileEvents.Names────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┬─ProfileEvents.Values───────────────────────────────┬─Settings.Names────────────────────────────────────────────────────────────────────────────────────────────────────────────────┬─Settings.Values──────────────────┬─current_database─┐
│ 1 │ default │ 0fb974b6-fbf8-4a96-a211-c6148c613ab7 │ ::ffff:192.168.84.249 │ 51284 │ default │ 0fb974b6-fbf8-4a96-a211-c6148c613ab7 │ ::ffff:192.168.84.249 │ 51284 │ 3 │ │ │ │ 0 │ 0 │ 0 │ 0 │ 0 │ │ │ │ │ 1016.223258107 │ 0 │ 0 │ 0 │ 0 │ 1 │ 9 │ 0 │ 0 │ insert into test_insert(i) values │ [141] │ ['Query','InsertQuery','QueryTimeMicroseconds','InsertQueryTimeMicroseconds','IOBufferAllocs','IOBufferAllocBytes','FunctionExecute','InsertedRows','InsertedBytes','SelectedRows','SelectedBytes','ContextLock','RWLockAcquiredReadLocks','RealTimeMicroseconds','UserTimeMicroseconds','SystemTimeMicroseconds'] │ [1,1,438,438,1,1048591,2,1,9,1,9,18,2,571,237,177] │ ['max_threads','use_uncompressed_cache','aggregation_memory_efficient_merge_threads','max_execution_time','max_memory_usage'] │ ['4','0','0','300','6442450944'] │ system │
│ 1 │ default │ f6140ae8-8f77-49a9-bc26-d79471495334 │ ::ffff:192.168.84.249 │ 52600 │ default │ f6140ae8-8f77-49a9-bc26-d79471495334 │ ::ffff:192.168.84.249 │ 52600 │ 3 │ │ │ │ 0 │ 0 │ 0 │ 0 │ 0 │ │ │ │ │ 957.173267506 │ 0 │ 1 │ 1 │ 0 │ 0 │ 0 │ 0 │ 0 │ select toUInt32(5593) as n │ [140,137] │ ['Query','SelectQuery','QueryTimeMicroseconds','SelectQueryTimeMicroseconds','SelectedRows','SelectedBytes','ContextLock','RWLockAcquiredReadLocks','RealTimeMicroseconds','UserTimeMicroseconds','SoftPageFaults'] │ [1,1,983,983,1,1,20,1,1317,1010,1] │ ['max_threads','use_uncompressed_cache','aggregation_memory_efficient_merge_threads','max_execution_time','max_memory_usage'] │ ['4','0','0','300','6442450944'] │ system │
└──────────────────┴─────────┴──────────────────────────────────────┴───────────────────────┴───────┴──────────────┴──────────────────────────────────────┴───────────────────────┴──────────────┴───────────┴─────────┴─────────────────┴─────────────┴─────────────────┴──────────────────────┴──────────────────────┴──────────────────────┴─────────────┴─────────────────┴──────────────┴───────────────┴───────────┴────────────────┴──────────────┴───────────┴────────────┴───────────────────┴──────────────┴───────────────┴──────────────┴───────────────────┴───────────────────────────────────┴────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴────────────────────────────────────────────────────┴───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴──────────────────────────────────┴──────────────────┘
@zhicwu
Copy link
Author

zhicwu commented Jul 26, 2021

And not able to kill the queries(after shutdown client for a while).

KILL QUERY WHERE isNotNull(query_id) SYNC

Query id: eba2637e-e07c-4567-b36a-7219fc2668e2

┌─kill_status─┬─query_id─────────────────────────────┬─user────┬─query─────────────────────────────┐
│ cant_cancel │ 0fb974b6-fbf8-4a96-a211-c6148c613ab7 │ default │ insert into test_insert(i) values │
└─────────────┴──────────────────────────────────────┴─────────┴───────────────────────────────────┘
← Progress: 4.00 rows, 3.15 KB (19.64 rows/s., 15.46 KB/s.)  99%

@zhicwu
Copy link
Author

zhicwu commented Jul 26, 2021

[Normal]

40765	97.447772	<client ip>	<server ip>	HTTP2	71	GOAWAY[0]
40767	97.447825	<client ip>	<server ip>	TCP	54	51283 → 9100 [FIN, ACK] Seq=7460 Ack=4844 Win=1572864 Len=0
40773	97.458352	<server ip>	<client ip>	TCP	54	9100 → 51283 [FIN, ACK] Seq=4844 Ack=7461 Win=30336 Len=0
40774	97.458387	<client ip>	<server ip>	TCP	54	51283 → 9100 [ACK] Seq=7461 Ack=4845 Win=1572864 Len=0

[51284]

40764	97.447750	<client ip>	<server ip>	HTTP2	71	GOAWAY[0]
40766	97.447825	<client ip>	<server ip>	TCP	54	51284 → 9100 [FIN, ACK] Seq=7602 Ack=4852 Win=1572864 Len=0
40768	97.454413	<server ip>	<client ip>	TCP	54	9100 → 51284 [ACK] Seq=4852 Ack=7602 Win=30336 Len=0
40769	97.454587	<server ip>	<client ip>	HTTP2	71	PING[0]
40770	97.454621	<client ip>	<server ip>	TCP	54	51284 → 9100 [RST, ACK] Seq=7603 Ack=4869 Win=0 Len=0
40775	97.458712	<server ip>	<client ip>	TCP	54	9100 → 51284 [FIN, ACK] Seq=4869 Ack=7603 Win=30336 Len=0

image

[52600]

81736	156.297473	<client ip>	<server ip>	HTTP2	76	HEADERS[1759]: POST /clickhouse.grpc.ClickHouse/ExecuteQueryWithStreamIO
81737	156.297584	<client ip>	<server ip>	GRPC	141	DATA[1759] (GRPC) (PROTOBUF) clickhouse.grpc.QueryInfo
81738	156.305481	<server ip>	<client ip>	HTTP2	71	PING[0]
81739	156.305641	<server ip>	<client ip>	TCP	54	9100 → 52600 [ACK] Seq=102748 Ack=111260 Win=30336 Len=0
81740	156.348133	<client ip>	<server ip>	TCP	54	52600 → 9100 [ACK] Seq=111260 Ack=102748 Win=1572864 Len=0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment