milvus/internal/datanode
bjzhjing 548c82eca5
Refactor storage.MergeInsertData() to optimize the merging process (#26839)
Benchmark Milvus with https://github.com/qdrant/vector-db-benchmark and
specify the datasets as 'deep-image-96-angular'. Meanwhile, do perf
profiling during 'upload + index' stage of vector-db-benchmark and see
the following hot spots.

39.59%--github.com/milvus-io/milvus/internal/storage.MergeInsertData
        |
        |--21.43%--github.com/milvus-io/milvus/internal/storage.MergeFieldData
        |          |
        |          |--17.22%--runtime.memmove
        |                     |
        |                     |--1.53%--asm_exc_page_fault
        |                     ......
        |
        |--18.16%--runtime.memmove
                   |
                   |--1.66%--asm_exc_page_fault
                   ......

The hot code path is in storage.MergeInsertData() which updates
buffer.buffer by creating a new 'InsertData' instance and merging both
the old buffer.buffer and addedBuffer into it. When it calls golang
runtime.memmove to move buffer.buffer which is with big size (>1M), the
hot spots appear.

To avoid the above overhead, update storage.MergeInsertData() by
appending addedBuffer to buffer.buffer, instead of moving buffer.buffer
and addedBuffer to a new 'InsertData'. This change removes the hot spots
'runtime.memmove' from perf profiling output. Additionally, the 'upload
+ index' time, which is one performance metric of vector-db-benchmark,
is reduced around 60% with this change.

Signed-off-by: Cathy Zhang <cathy.zhang@intel.com>
2023-09-05 21:41:48 +08:00
..
allocator Add cpp-build and setenv for querynode mockery regen command (#26843) 2023-09-05 14:13:49 +08:00
binlog_io_test.go Use go-api/v2 for milvus-proto (#24770) 2023-06-09 01:28:37 +08:00
binlog_io.go Add compaction log (#24976) 2023-06-19 14:18:41 +08:00
buffer_test.go Decouple basetable and componentparam (#26725) 2023-09-05 10:31:48 +08:00
buffer.go Use go-api/v2 for milvus-proto (#24770) 2023-06-09 01:28:37 +08:00
cache_test.go Make duplicate flush recalls success and other logic update (#16755) 2022-05-06 17:49:51 +08:00
cache.go Use typeutil.ConcurrentMap instead of sync.Map (#25846) 2023-07-24 10:23:01 +08:00
channel_meta_test.go fix sync memory policy lose effect when inserting too many partitions(#25763) (#26154) 2023-08-07 09:59:07 +08:00
channel_meta.go Merge syncCPLagTooBehind policy into syncPeriodically policy (#26713) 2023-09-04 14:37:47 +08:00
compaction_executor_test.go Use typeutil.ConcurrentMap instead of sync.Map (#25846) 2023-07-24 10:23:01 +08:00
compaction_executor.go Use typeutil.ConcurrentMap instead of sync.Map (#25846) 2023-07-24 10:23:01 +08:00
compactor_test.go Remove TimeTravel in compactor (#26785) 2023-09-04 17:41:48 +08:00
compactor.go Remove TimeTravel in compactor (#26785) 2023-09-04 17:41:48 +08:00
data_node_test.go Decouple basetable and componentparam (#26725) 2023-09-05 10:31:48 +08:00
data_node.go Fix datanode graceful stop panic (#25932) 2023-07-28 10:11:08 +08:00
data_sync_service_test.go Decouple basetable and componentparam (#26725) 2023-09-05 10:31:48 +08:00
data_sync_service.go Use atomic.bool for the isWatchFailed param in the tickler (#26558) 2023-08-23 13:22:27 +08:00
event_manager_test.go Use cockroachdb/errors to replace other error pkg (#22390) 2023-02-26 11:31:49 +08:00
event_manager.go Use atomic.bool for the isWatchFailed param in the tickler (#26558) 2023-08-23 13:22:27 +08:00
flow_graph_dd_node_test.go Refactor logs in DataCoord & DataNode (#25574) 2023-07-14 15:56:31 +08:00
flow_graph_dd_node.go Remove unused hash value setting in DDNode (#26575) 2023-08-28 11:30:26 +08:00
flow_graph_delete_node_test.go Decouple basetable and componentparam (#26725) 2023-09-05 10:31:48 +08:00
flow_graph_delete_node.go Remove log.Error(err.error())-style log (#26783) 2023-09-01 13:09:01 +08:00
flow_graph_dmstream_input_node_test.go Remove QueryMsgStream in MqFactory interface (#26374) 2023-08-16 10:29:33 +08:00
flow_graph_dmstream_input_node.go Only do gracefully stop when DN Stop (#26399) 2023-08-21 11:16:20 +08:00
flow_graph_insert_buffer_node_test.go Decouple basetable and componentparam (#26725) 2023-09-05 10:31:48 +08:00
flow_graph_insert_buffer_node.go Refactor storage.MergeInsertData() to optimize the merging process (#26839) 2023-09-05 21:41:48 +08:00
flow_graph_manager_test.go Decouple basetable and componentparam (#26725) 2023-09-05 10:31:48 +08:00
flow_graph_manager.go Log out memory in MB (#26262) 2023-08-30 17:13:00 +08:00
flow_graph_message_test.go
flow_graph_message.go Use go-api/v2 for milvus-proto (#24770) 2023-06-09 01:28:37 +08:00
flow_graph_node.go Make flow graph retry longer (#24355) 2023-05-25 09:53:30 +08:00
flow_graph_time_tick_node.go Use go-api/v2 for milvus-proto (#24770) 2023-06-09 01:28:37 +08:00
flow_graph_time_ticker.go Move some modules from internal to public package (#22572) 2023-04-06 19:14:32 +08:00
flush_manager_test.go Retry on SyncSegment failure (#25540) 2023-07-13 14:12:29 +08:00
flush_manager.go Make write binlog in parallel (#26325) 2023-08-17 15:44:18 +08:00
flush_task_test.go Move some modules from internal to public package (#22572) 2023-04-06 19:14:32 +08:00
flush_task.go Refactor logs in DataCoord & DataNode (#25574) 2023-07-14 15:56:31 +08:00
io_pool_test.go Fix copylocks linter errors (#26217) 2023-08-08 20:41:15 +08:00
io_pool.go use single instance ppol (#25159) 2023-06-28 14:54:45 +08:00
meta_service_test.go Use go-api/v2 for milvus-proto (#24770) 2023-06-09 01:28:37 +08:00
meta_service.go [Cherry-Pick] Support Database (#24769) 2023-06-25 17:20:43 +08:00
meta_util.go Use go-api/v2 for milvus-proto (#24770) 2023-06-09 01:28:37 +08:00
metrics_info.go Refine errors to remove changes breaking design (#26521) 2023-09-04 09:57:09 +08:00
mock_test.go Bulkinsert supports partition keys (#25284) 2023-07-11 15:18:28 +08:00
OWNERS [skip ci]Update OWNERS files (#11898) 2021-11-16 15:41:11 +08:00
rate_collector_test.go Move some modules from internal to public package (#22572) 2023-04-06 19:14:32 +08:00
rate_collector.go Fix global rateCollector init multiple times (#23703) 2023-04-26 10:16:36 +08:00
README.md
segment_sync_policy_test.go Decouple basetable and componentparam (#26725) 2023-09-05 10:31:48 +08:00
segment_sync_policy.go Merge syncCPLagTooBehind policy into syncPeriodically policy (#26713) 2023-09-04 14:37:47 +08:00
segment_test.go Move some modules from internal to public package (#22572) 2023-04-06 19:14:32 +08:00
segment.go Merge syncCPLagTooBehind policy into syncPeriodically policy (#26713) 2023-09-04 14:37:47 +08:00
services_test.go Use typeutil.ConcurrentMap instead of sync.Map (#25846) 2023-07-24 10:23:01 +08:00
services.go Merge syncCPLagTooBehind policy into syncPeriodically policy (#26713) 2023-09-04 14:37:47 +08:00
timetick_sender_test.go Organize mocks from types.go (#25466) 2023-07-14 10:12:31 +08:00
timetick_sender.go Reduce log frequency in timetick_sender (#25532) 2023-07-13 14:38:29 +08:00
util.go merge stats log when segment flushing or compacting (#23570) 2023-05-29 10:21:28 +08:00

Data Node

DataNode is the component to write insert and delete messages into persistent blob storage, for example MinIO or S3.

Dependency

  • KV store: a kv store that persists messages into blob storage.
  • Message stream: receive messages and publish imformation
  • Root Coordinator: get the latest unique IDs.
  • Data Coordinator: get the flush information and which message stream to subscribe.