-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade go from 1.20 to 1.21 #33047
Upgrade go from 1.20 to 1.21 #33047
Conversation
Invalid PR Title Format Detected Your PR submission does not adhere to our required standards. To ensure clarity and consistency, please meet the following criteria:
Required Title Structure:
Where Example:
Please review and update your PR to comply with these guidelines. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #33047 +/- ##
==========================================
- Coverage 82.14% 82.13% -0.01%
==========================================
Files 1006 1006
Lines 128452 128452
==========================================
- Hits 105513 105510 -3
- Misses 18948 18952 +4
+ Partials 3991 3990 -1 |
just curious. |
@shaoting-huang Thanks for your contribution. Please submit with DCO, see the contributing guide https://github.com/milvus-io/milvus/blob/master/CONTRIBUTING.md#developer-certificate-of-origin-dco. |
@shaoting-huang E2e jenkins job failed, comment |
1 similar comment
@shaoting-huang E2e jenkins job failed, comment |
/approve very detailed test result! |
5ba43ca
to
851eb05
Compare
@shaoting-huang E2e jenkins job failed, comment |
@shaoting-huang ut workflow job failed, comment |
Yes, as the profiling graph above, pprof collects go profiling and c++ profiling. |
5846258
to
4a795c7
Compare
@shaoting-huang Thanks for your contribution. Please submit with DCO, see the contributing guide https://github.com/milvus-io/milvus/blob/master/CONTRIBUTING.md#developer-certificate-of-origin-dco. |
Signed-off-by: shaoting-huang <[email protected]>
6467496
to
74395f0
Compare
rerun ut |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: shaoting-huang, xiaofan-luan The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: shaoting-huang [[email protected]]
issue: #32982
Background
Go 1.21 introduces several improvements and changes over Go 1.20, which is quite stable now. According to
Go 1.21 Release Notes, the big difference of Go 1.21 is enabling Profile-Guided Optimization by default, which can improve performance by around 2-14%. Here are the summary steps of PGO:
What does this PR do
There are three experiments, search benchmark by Zilliz test platform, search benchmark by open-source VectorDBBench, and search benchmark with PGO. We do both search benchmarks by Zilliz test platform and by VectorDBBench to reduce reliance on a single experimental result. Besides, we validate the performance enhancement with PGO.
Search Benchmark Report by Zilliz Test Platform
An upgrade to Go 1.21 was conducted on a Milvus Standalone server, equipped with 16 CPUs and 64GB of memory. The search performance was evaluated using a 1 million entry local dataset with an L2 metric type in a 768-dimensional space. The system was tested for concurrent searches with 50 concurrent tasks for 1 hour, each with a 20-second interval. The reason for using one server rather than two servers to compare is to guarantee the same data source and same segment state after compaction.
Test Sequence:
Search Metrics:
search requests
search fails
search RT_avg
(ms)search RT_min
(ms)search RT_max
(ms)search TP50
(ms)search TP99
(ms)search RPS
Key Findings
The benchmark tests reveal that the index build time with Go 1.20 at 340.39 ms and Go 1.21 at 337.60 ms demonstrated negligible performance variance in index construction. However, Go 1.21 offers slightly better performance in search operations compared to Go 1.20, with improvements in handling concurrent tasks and reducing response times.
Search Benchmark Report By VectorDb Bench
Follow VectorDBBench to create a VectorDb Bench test for Go 1.20 and Go 1.21. We test the search performance with Go 1.20 and Go 1.21 (without PGO) on the Milvus Standalone system. The tests were conducted using the Cohere dataset with 1 million entries in a 768-dimensional space, utilizing the COSINE metric type.
Search Metrics:
Key Findings
Go 1.21 indicates faster index loading times and larger search QPS handling.
PGO Performance Test
Milvus has already added net/http/pprof in the metrics. So we can curl the CPU profile directly by running
curl -o default.pgo "http://${MILVUS_SERVER_IP}:${MILVUS_SERVER_PORT}/debug/pprof/profile?seconds=${TIME_SECOND}"
to collect the profile as the default.pgo during the first search. Then I build Milvus with PGO and use the same index to run the search again. The result is as below:
Search Metrics
search Requests
search Fails
search RT_avg
(ms)search RT_min
(ms)search RT_max
(ms)search TP50
(ms)search TP99
(ms)search RPS
Key Findings
PGO led to a notable enhancement in search performance, particularly in reducing the maximum response time by 58% and increasing the search QPS by 7.3%.
Further Analysis
Generate a diff flame graphs between two CPU profiles by running
Further insight of HnswIndexNode and Milvus Search Handlergo tool pprof -http=:8000 -diff_base nopgo.pgo pgo.pgo -normalize
After applying PGO to the Milvus server, the CPU utilization of the faiss::fvec_L2 function has decreased. This optimization significantly enhances the performance of the HnswIndexNode::Search::searchKnn method, which is frequently invoked by Knowhere during high-concurrency searches. As the explanation from Go release notes, the function might be more aggressively inlined by Go compiler during the second build with the CPU profiling collected from the first run. As a result, the search handler efficiency within Milvus DataNode has improved, allowing the server to process a higher number of search queries per second (QPS).
Conclusion
The combination of Go 1.21 and PGO has led to substantial enhancements in search performance for Milvus server, particularly in terms of search QPS and response times, making it more efficient for handling high-concurrency search operations.