为什么Clickhouse分布式表insert into 操作会变慢
发布于 2 个月前 作者 sentimentalbunny 330 次浏览 来自 问答

求大神解答,三台机器(每台机器内存128G)组成的集群,一张1200万左右数据的分布式表,执行inser into耗时5242ms,insert into操作的并发量是一分钟800次,我在系统表system.query_thread_log查询最慢的一次insert的ProfileEvents.Names如下: [‘Query’,‘InsertQuery’,‘FileOpen’,‘WriteBufferFromFileDescriptorWrite’,‘WriteBufferFromFileDescriptorWriteBytes’,‘IOBufferAllocs’, ‘IOBufferAllocBytes’,‘CreatedWriteBufferOrdinary’,‘DiskWriteElapsedMicroseconds’,‘InsertedRows’,‘InsertedBytes’,‘MergeTreeDataWriterRows’, ‘MergeTreeDataWriterUncompressedBytes’,‘MergeTreeDataWriterCompressedBytes’,‘MergeTreeDataWriterBlocks’,‘MergeTreeDataWriterBlocksAlreadySorted’, ‘ContextLock’,‘RWLockAcquiredReadLocks’, ‘RealTimeMicroseconds’,‘SystemTimeMicroseconds’,‘SoftPageFaults’,‘OSCPUVirtualTimeMicroseconds’,‘OSWriteBytes’,‘OSWriteChars’]

这种情况不是一直出现,是偶尔出现,312540次insert操作中有581次操作超过1000ms,超过2000ms的有 最慢的一次耗时5242ms,我比较耗时最短发现,慢insert的ProfileEvents.Names多了几个过程:CreatedWriteBufferOrdinary,MergeTreeDataWriterRows,MergeTreeDataWriterUncompressedBytes,MergeTreeDataWriterCompresse dBytes,MergeTreeDataWriterBlocks,MergeTreeDataWriterBlocksAlreadySorted,SystemTimeMicroseconds,OSCPUVirtualTimeMicroseconds

这是为啥呀。。。。

回到顶部