Skip to content

Conversation

freemandealer
Copy link
Contributor

@freemandealer freemandealer commented Oct 24, 2024

  • Enhance cache performance and reduce cache misses by:
    • Prevent starvation of any particular cache.
    • Improve disk space utilization.
    • Maintain strict and systematic eviction priorities.
  • Enhance the observability of caching strategies, allowing cache behavior to be intuitively self-explanatory through monitoring.
  • Improve code comprehensibility: unify the cache framework to avoid ad-hoc handling of TTL, increasing the modularity of the code.
  • Reduce operational complexity by eliminating and standardizing configuration items.

@doris-robot
Copy link

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR

Since 2024-03-18, the Document has been moved to doris-website.
See Doris Document.

@freemandealer
Copy link
Contributor Author

run buildall

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@doris-robot
Copy link

TPC-H: Total hot run time: 41625 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit e05a9d7ac40fc81cd772d07933f7c54f8b03aca9, data reload: false

------ Round 1 ----------------------------------
q1	17598	7606	7296	7296
q2	2053	176	155	155
q3	10561	1162	1129	1129
q4	10227	893	873	873
q5	7740	3185	3105	3105
q6	234	144	143	143
q7	1015	620	606	606
q8	9360	1984	2027	1984
q9	6686	6422	6403	6403
q10	7026	2446	2425	2425
q11	449	251	249	249
q12	401	216	213	213
q13	17783	2992	3023	2992
q14	247	209	213	209
q15	568	525	510	510
q16	636	585	588	585
q17	979	580	528	528
q18	7584	6810	6763	6763
q19	1345	1046	999	999
q20	487	181	180	180
q21	4065	3652	3277	3277
q22	1101	1001	1025	1001
Total cold run time: 108145 ms
Total hot run time: 41625 ms

----- Round 2, with runtime_filter_mode=off -----
q1	7268	7194	7235	7194
q2	335	225	228	225
q3	2929	2798	2780	2780
q4	1965	1748	1719	1719
q5	5487	5494	5548	5494
q6	220	138	143	138
q7	2132	1708	1717	1708
q8	3234	3396	3430	3396
q9	8600	8591	8590	8590
q10	3465	3492	3429	3429
q11	574	490	481	481
q12	788	555	586	555
q13	9643	3008	3005	3005
q14	311	255	261	255
q15	555	504	502	502
q16	670	646	658	646
q17	1840	1616	1568	1568
q18	7914	7539	7355	7355
q19	1671	1592	1597	1592
q20	2072	1804	1808	1804
q21	5399	5251	5211	5211
q22	1135	1044	1023	1023
Total cold run time: 68207 ms
Total hot run time: 58670 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 192350 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit e05a9d7ac40fc81cd772d07933f7c54f8b03aca9, data reload: false

query1	979	376	374	374
query2	6538	2036	2090	2036
query3	6787	212	233	212
query4	34028	23571	23561	23561
query5	4348	455	458	455
query6	270	179	177	177
query7	4612	290	298	290
query8	304	237	234	234
query9	9701	2712	2718	2712
query10	484	244	251	244
query11	18228	15256	15232	15232
query12	149	101	98	98
query13	1679	436	407	407
query14	10074	7476	7258	7258
query15	306	181	176	176
query16	7563	422	417	417
query17	1736	543	550	543
query18	1987	292	299	292
query19	380	146	144	144
query20	112	109	108	108
query21	205	103	102	102
query22	4629	4465	4276	4276
query23	34650	34102	34340	34102
query24	11125	2762	2763	2762
query25	624	378	393	378
query26	1175	163	160	160
query27	2385	278	303	278
query28	7638	2438	2450	2438
query29	817	432	426	426
query30	325	166	162	162
query31	1043	822	828	822
query32	99	55	56	55
query33	757	268	265	265
query34	987	534	528	528
query35	1025	894	884	884
query36	1094	956	976	956
query37	129	79	74	74
query38	4384	4348	4299	4299
query39	1488	1414	1435	1414
query40	206	102	101	101
query41	51	47	47	47
query42	112	103	102	102
query43	554	515	512	512
query44	1294	810	803	803
query45	186	168	165	165
query46	1144	682	727	682
query47	1968	1878	1862	1862
query48	428	338	325	325
query49	1154	414	413	413
query50	798	397	378	378
query51	7044	7040	6960	6960
query52	105	90	89	89
query53	262	180	183	180
query54	1263	423	420	420
query55	83	80	79	79
query56	270	250	256	250
query57	1361	1175	1196	1175
query58	243	208	219	208
query59	3191	3163	3071	3071
query60	292	259	264	259
query61	127	123	124	123
query62	881	684	665	665
query63	225	195	191	191
query64	5179	710	711	710
query65	3288	3244	3220	3220
query66	1455	307	296	296
query67	16222	15893	15566	15566
query68	4652	554	571	554
query69	449	260	258	258
query70	1232	1172	1191	1172
query71	331	273	261	261
query72	6370	3924	3945	3924
query73	757	360	366	360
query74	10223	9063	8976	8976
query75	3423	2673	2636	2636
query76	3061	1015	1047	1015
query77	421	290	285	285
query78	10633	9584	9577	9577
query79	1431	596	602	596
query80	1069	440	414	414
query81	543	241	249	241
query82	950	120	116	116
query83	214	140	138	138
query84	233	69	67	67
query85	1236	292	283	283
query86	357	306	284	284
query87	4909	4615	4722	4615
query88	3446	2241	2169	2169
query89	394	291	286	286
query90	1912	185	184	184
query91	134	98	105	98
query92	60	49	48	48
query93	1088	544	542	542
query94	818	285	295	285
query95	352	250	248	248
query96	617	288	282	282
query97	2830	2713	2689	2689
query98	215	205	195	195
query99	1540	1349	1357	1349
Total cold run time: 300130 ms
Total hot run time: 192350 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 32.8 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit e05a9d7ac40fc81cd772d07933f7c54f8b03aca9, data reload: false

query1	0.03	0.03	0.02
query2	0.06	0.03	0.03
query3	0.23	0.07	0.06
query4	1.64	0.10	0.11
query5	0.43	0.40	0.41
query6	1.14	0.65	0.67
query7	0.02	0.02	0.02
query8	0.04	0.03	0.04
query9	0.57	0.52	0.50
query10	0.56	0.55	0.55
query11	0.14	0.11	0.11
query12	0.14	0.10	0.11
query13	0.62	0.59	0.59
query14	2.75	2.72	2.74
query15	0.90	0.82	0.85
query16	0.40	0.39	0.38
query17	1.05	1.07	1.05
query18	0.20	0.20	0.19
query19	1.94	1.84	1.91
query20	0.02	0.01	0.01
query21	15.35	0.59	0.62
query22	2.47	2.34	1.77
query23	17.24	0.91	0.86
query24	3.43	1.11	1.76
query25	0.25	0.07	0.05
query26	0.54	0.14	0.14
query27	0.03	0.04	0.04
query28	9.86	1.09	1.07
query29	12.66	3.36	3.33
query30	0.25	0.06	0.05
query31	2.87	0.38	0.39
query32	3.27	0.47	0.46
query33	3.00	3.02	3.05
query34	17.01	4.50	4.49
query35	4.49	4.50	4.48
query36	0.66	0.48	0.48
query37	0.09	0.06	0.06
query38	0.05	0.04	0.03
query39	0.03	0.02	0.02
query40	0.17	0.13	0.14
query41	0.08	0.02	0.03
query42	0.03	0.02	0.02
query43	0.04	0.03	0.03
Total cold run time: 106.75 s
Total hot run time: 32.8 s

@freemandealer freemandealer changed the title [enhancement] refine block file cache evict policy [enhancement](cloud) refine block file cache evict policy Oct 25, 2024
@freemandealer
Copy link
Contributor Author

run p0

1 similar comment
@freemandealer
Copy link
Contributor Author

run p0

Signed-off-by: freemandealer <[email protected]>
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@gavinchou
Copy link
Contributor

This PR introduce some behavior change, pls describe what it is

Signed-off-by: freemandealer <[email protected]>
Signed-off-by: freemandealer <[email protected]>
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

context.cache_type = io::FileCacheType::TTL;
context.expiration_time = UnixSeconds() + 3600;

auto sp = SyncPoint::get_instance();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: 'auto sp' can be declared as 'auto *sp' [readability-qualified-auto]

Suggested change
auto sp = SyncPoint::get_instance();
s);auto *

Comment on lines +4901 to +4902
;
EXPECT_EQ(cache._cur_cache_size, 30);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: statement should be inside braces [readability-braces-around-statements]

Suggested change
;
EXPECT_EQ(cache._cur_cache_size, 30);
he) {
;
}

if (fs::exists(cache_base_path)) {
fs::remove_all(cache_base_path);
}
fs::create_directories(cache_base_path);
auto sp = SyncPoint::get_instance();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: 'auto sp' can be declared as 'auto *sp' [readability-qualified-auto]

Suggested change
auto sp = SyncPoint::get_instance();
h);auto *

@@ -5493,4 +5283,400 @@
}
}

TEST_F(BlockFileCacheTest, populate_empty_cache_with_disposable) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function 'TEST_F' exceeds recommended size/complexity thresholds [readability-function-size]

    ^
Additional context

be/test/io/cache/block_file_cache_test.cpp:5285: 103 lines including whitespace and comments (threshold 80)

    ^

}
}

TEST_F(BlockFileCacheTest, disposable_seize_after_normal) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function 'TEST_F' exceeds recommended size/complexity thresholds [readability-function-size]

    ^
Additional context

be/test/io/cache/block_file_cache_test.cpp:5390: 115 lines including whitespace and comments (threshold 80)

    ^

}
}

TEST_F(BlockFileCacheTest, evict_privilege_order) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function 'TEST_F' exceeds recommended size/complexity thresholds [readability-function-size]

    ^
Additional context

be/test/io/cache/block_file_cache_test.cpp:5507: 172 lines including whitespace and comments (threshold 80)

    ^

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

}
}

TEST_F(BlockFileCacheTest, populate_empty_cache_with_normal) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function 'TEST_F' exceeds recommended size/complexity thresholds [readability-function-size]

    ^
Additional context

be/test/io/cache/block_file_cache_test.cpp:5390: 102 lines including whitespace and comments (threshold 80)

    ^

}
}

TEST_F(BlockFileCacheTest, populate_empty_cache_with_index) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function 'TEST_F' exceeds recommended size/complexity thresholds [readability-function-size]

    ^
Additional context

be/test/io/cache/block_file_cache_test.cpp:5494: 102 lines including whitespace and comments (threshold 80)

    ^

}
}

TEST_F(BlockFileCacheTest, populate_empty_cache_with_ttl) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function 'TEST_F' exceeds recommended size/complexity thresholds [readability-function-size]

    ^
Additional context

be/test/io/cache/block_file_cache_test.cpp:5598: 102 lines including whitespace and comments (threshold 80)

    ^

}
}

TEST_F(BlockFileCacheTest, disposable_seize_after_normal) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function 'TEST_F' exceeds recommended size/complexity thresholds [readability-function-size]

    ^
Additional context

be/test/io/cache/block_file_cache_test.cpp:5702: 115 lines including whitespace and comments (threshold 80)

    ^

}
}

TEST_F(BlockFileCacheTest, evict_privilege_order_for_disposable) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function 'TEST_F' exceeds recommended size/complexity thresholds [readability-function-size]

    ^
Additional context

be/test/io/cache/block_file_cache_test.cpp:5819: 172 lines including whitespace and comments (threshold 80)

    ^

}
}

TEST_F(BlockFileCacheTest, evict_privilege_order_for_normal) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function 'TEST_F' exceeds recommended size/complexity thresholds [readability-function-size]

    ^
Additional context

be/test/io/cache/block_file_cache_test.cpp:5993: 171 lines including whitespace and comments (threshold 80)

    ^

}
}

TEST_F(BlockFileCacheTest, evict_privilege_order_for_index) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function 'TEST_F' exceeds recommended size/complexity thresholds [readability-function-size]

    ^
Additional context

be/test/io/cache/block_file_cache_test.cpp:6166: 171 lines including whitespace and comments (threshold 80)

    ^

}
}

TEST_F(BlockFileCacheTest, evict_privilege_order_for_ttl) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function 'TEST_F' exceeds recommended size/complexity thresholds [readability-function-size]

    ^
Additional context

be/test/io/cache/block_file_cache_test.cpp:6339: 171 lines including whitespace and comments (threshold 80)

    ^

Signed-off-by: freemandealer <[email protected]>
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

}
}

TEST_F(BlockFileCacheTest, seize_after_full) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function 'TEST_F' exceeds recommended size/complexity thresholds [readability-function-size]

    ^
Additional context

be/test/io/cache/block_file_cache_test.cpp:5819: 155 lines including whitespace and comments (threshold 80)

    ^

}
}

TEST_F(BlockFileCacheTest, evict_privilege_order_for_disposable) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function 'TEST_F' exceeds recommended size/complexity thresholds [readability-function-size]

    ^
Additional context

be/test/io/cache/block_file_cache_test.cpp:5976: 172 lines including whitespace and comments (threshold 80)

    ^

}
}

TEST_F(BlockFileCacheTest, evict_privilege_order_for_normal) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function 'TEST_F' exceeds recommended size/complexity thresholds [readability-function-size]

    ^
Additional context

be/test/io/cache/block_file_cache_test.cpp:6150: 171 lines including whitespace and comments (threshold 80)

    ^

}
}

TEST_F(BlockFileCacheTest, evict_privilege_order_for_index) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function 'TEST_F' exceeds recommended size/complexity thresholds [readability-function-size]

    ^
Additional context

be/test/io/cache/block_file_cache_test.cpp:6323: 171 lines including whitespace and comments (threshold 80)

    ^

}
}

TEST_F(BlockFileCacheTest, evict_privilege_order_for_ttl) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function 'TEST_F' exceeds recommended size/complexity thresholds [readability-function-size]

    ^
Additional context

be/test/io/cache/block_file_cache_test.cpp:6496: 171 lines including whitespace and comments (threshold 80)

    ^

Signed-off-by: freemandealer <[email protected]>
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

@@ -5493,4 +5284,1388 @@ TEST_F(BlockFileCacheTest, file_cache_path_storage_parse) {
}
}

TEST_F(BlockFileCacheTest, populate_empty_cache_with_disposable) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function 'TEST_F' exceeds recommended size/complexity thresholds [readability-function-size]

    ^
Additional context

be/test/io/cache/block_file_cache_test.cpp:5286: 103 lines including whitespace and comments (threshold 80)

    ^

}
}

TEST_F(BlockFileCacheTest, populate_empty_cache_with_normal) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function 'TEST_F' exceeds recommended size/complexity thresholds [readability-function-size]

    ^
Additional context

be/test/io/cache/block_file_cache_test.cpp:5391: 102 lines including whitespace and comments (threshold 80)

    ^

}
}

TEST_F(BlockFileCacheTest, populate_empty_cache_with_index) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function 'TEST_F' exceeds recommended size/complexity thresholds [readability-function-size]

    ^
Additional context

be/test/io/cache/block_file_cache_test.cpp:5495: 102 lines including whitespace and comments (threshold 80)

    ^

}
}

TEST_F(BlockFileCacheTest, populate_empty_cache_with_ttl) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function 'TEST_F' exceeds recommended size/complexity thresholds [readability-function-size]

    ^
Additional context

be/test/io/cache/block_file_cache_test.cpp:5599: 102 lines including whitespace and comments (threshold 80)

    ^

}
}

TEST_F(BlockFileCacheTest, disposable_seize_after_normal) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function 'TEST_F' exceeds recommended size/complexity thresholds [readability-function-size]

    ^
Additional context

be/test/io/cache/block_file_cache_test.cpp:5703: 115 lines including whitespace and comments (threshold 80)

    ^

}
}

TEST_F(BlockFileCacheTest, seize_after_full) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function 'TEST_F' exceeds recommended size/complexity thresholds [readability-function-size]

    ^
Additional context

be/test/io/cache/block_file_cache_test.cpp:5820: 155 lines including whitespace and comments (threshold 80)

    ^

}
}

TEST_F(BlockFileCacheTest, evict_privilege_order_for_disposable) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function 'TEST_F' exceeds recommended size/complexity thresholds [readability-function-size]

    ^
Additional context

be/test/io/cache/block_file_cache_test.cpp:5977: 172 lines including whitespace and comments (threshold 80)

    ^

}
}

TEST_F(BlockFileCacheTest, evict_privilege_order_for_normal) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function 'TEST_F' exceeds recommended size/complexity thresholds [readability-function-size]

    ^
Additional context

be/test/io/cache/block_file_cache_test.cpp:6151: 171 lines including whitespace and comments (threshold 80)

    ^

}
}

TEST_F(BlockFileCacheTest, evict_privilege_order_for_index) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function 'TEST_F' exceeds recommended size/complexity thresholds [readability-function-size]

    ^
Additional context

be/test/io/cache/block_file_cache_test.cpp:6324: 171 lines including whitespace and comments (threshold 80)

    ^

}
}

TEST_F(BlockFileCacheTest, evict_privilege_order_for_ttl) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function 'TEST_F' exceeds recommended size/complexity thresholds [readability-function-size]

    ^
Additional context

be/test/io/cache/block_file_cache_test.cpp:6497: 171 lines including whitespace and comments (threshold 80)

    ^

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 37.81% (9821/25975)
Line Coverage: 28.99% (81646/281679)
Region Coverage: 28.24% (42110/149115)
Branch Coverage: 24.82% (21365/86072)
Coverage Report: http://coverage.selectdb-in.cc/coverage/597cfd06745b209451592a1cd1544af449b6ea0d_597cfd06745b209451592a1cd1544af449b6ea0d/report/index.html

@doris-robot
Copy link

TPC-H: Total hot run time: 41575 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 597cfd06745b209451592a1cd1544af449b6ea0d, data reload: false

------ Round 1 ----------------------------------
q1	17591	7494	7311	7311
q2	2074	171	165	165
q3	10624	1134	1160	1134
q4	10217	821	815	815
q5	7772	3111	3115	3111
q6	240	150	148	148
q7	1019	612	602	602
q8	9350	1970	2029	1970
q9	6624	6474	6510	6474
q10	7129	2456	2407	2407
q11	473	260	267	260
q12	414	227	217	217
q13	17795	3022	2990	2990
q14	241	213	210	210
q15	574	519	509	509
q16	664	590	588	588
q17	1005	512	492	492
q18	7378	6737	6612	6612
q19	1330	1021	1048	1021
q20	467	183	188	183
q21	4267	3360	3340	3340
q22	1109	1016	1020	1016
Total cold run time: 108357 ms
Total hot run time: 41575 ms

----- Round 2, with runtime_filter_mode=off -----
q1	7317	7480	7293	7293
q2	324	223	225	223
q3	3014	2964	2921	2921
q4	2119	1923	1833	1833
q5	5765	5790	5795	5790
q6	229	150	149	149
q7	2266	1877	1819	1819
q8	3402	3543	3448	3448
q9	9006	8954	8967	8954
q10	3575	3559	3580	3559
q11	606	502	496	496
q12	853	638	616	616
q13	11262	3160	3164	3160
q14	313	270	273	270
q15	564	540	525	525
q16	688	661	659	659
q17	1905	1648	1607	1607
q18	8406	7716	7759	7716
q19	1751	1606	1512	1512
q20	2155	1882	1868	1868
q21	5627	5581	5455	5455
q22	1150	1055	1059	1055
Total cold run time: 72297 ms
Total hot run time: 60928 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 196015 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 597cfd06745b209451592a1cd1544af449b6ea0d, data reload: false

query1	1226	930	893	893
query2	6232	2163	2135	2135
query3	10763	4029	4031	4029
query4	67980	28290	23650	23650
query5	5001	441	429	429
query6	393	177	161	161
query7	5635	297	309	297
query8	316	225	222	222
query9	9303	2758	2763	2758
query10	471	253	256	253
query11	17633	15453	15928	15453
query12	158	99	105	99
query13	1565	441	422	422
query14	10476	7152	6601	6601
query15	214	192	185	185
query16	7093	416	449	416
query17	1023	561	548	548
query18	1788	292	297	292
query19	204	155	147	147
query20	113	113	113	113
query21	207	101	102	101
query22	4690	4391	4227	4227
query23	34510	34027	34141	34027
query24	5989	2797	2740	2740
query25	508	401	392	392
query26	648	159	158	158
query27	1702	282	298	282
query28	4297	2455	2454	2454
query29	663	421	421	421
query30	236	152	156	152
query31	1005	775	835	775
query32	65	53	58	53
query33	460	264	276	264
query34	889	518	501	501
query35	849	743	738	738
query36	1079	952	942	942
query37	113	70	79	70
query38	4415	4220	4366	4220
query39	1487	1419	1418	1418
query40	204	97	97	97
query41	47	45	45	45
query42	108	96	93	93
query43	539	490	498	490
query44	1183	821	821	821
query45	182	165	164	164
query46	1129	689	692	689
query47	1975	1860	1878	1860
query48	429	320	335	320
query49	728	415	400	400
query50	814	404	402	402
query51	7284	7222	7172	7172
query52	97	88	91	88
query53	260	183	181	181
query54	521	406	399	399
query55	78	78	76	76
query56	257	242	260	242
query57	1300	1159	1159	1159
query58	208	201	204	201
query59	3372	3104	2988	2988
query60	284	241	243	241
query61	102	93	110	93
query62	787	673	676	673
query63	221	192	184	184
query64	1338	618	597	597
query65	3264	3167	3221	3167
query66	620	325	300	300
query67	15862	15815	15839	15815
query68	3305	582	584	582
query69	409	254	248	248
query70	1213	1135	1143	1135
query71	326	255	257	255
query72	6215	4011	3973	3973
query73	765	360	371	360
query74	9835	9084	9109	9084
query75	3408	2656	2625	2625
query76	1741	1108	1090	1090
query77	504	286	266	266
query78	10308	9420	9406	9406
query79	1127	576	580	576
query80	790	418	439	418
query81	521	237	239	237
query82	1243	117	120	117
query83	152	132	138	132
query84	275	68	65	65
query85	840	307	285	285
query86	329	304	299	299
query87	4895	4658	4600	4600
query88	3396	2196	2145	2145
query89	412	283	288	283
query90	1936	185	187	185
query91	138	101	99	99
query92	58	48	55	48
query93	1195	540	535	535
query94	712	301	275	275
query95	341	249	246	246
query96	611	279	284	279
query97	2933	2671	2696	2671
query98	214	211	201	201
query99	1589	1324	1300	1300
Total cold run time: 316328 ms
Total hot run time: 196015 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 32.62 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 597cfd06745b209451592a1cd1544af449b6ea0d, data reload: false

query1	0.04	0.03	0.03
query2	0.07	0.03	0.03
query3	0.23	0.06	0.06
query4	1.64	0.10	0.10
query5	0.41	0.40	0.39
query6	1.17	0.65	0.65
query7	0.02	0.01	0.01
query8	0.04	0.03	0.03
query9	0.56	0.49	0.49
query10	0.55	0.55	0.55
query11	0.15	0.11	0.10
query12	0.13	0.11	0.11
query13	0.60	0.59	0.59
query14	2.70	2.83	2.71
query15	0.90	0.83	0.83
query16	0.39	0.38	0.38
query17	0.98	0.99	1.06
query18	0.20	0.19	0.21
query19	1.87	1.78	1.90
query20	0.01	0.01	0.01
query21	15.40	0.59	0.57
query22	2.69	1.75	1.61
query23	17.10	1.00	0.79
query24	2.79	1.56	1.78
query25	0.28	0.11	0.21
query26	0.39	0.15	0.14
query27	0.05	0.05	0.04
query28	10.00	1.09	1.08
query29	12.54	3.21	3.18
query30	0.25	0.06	0.05
query31	2.90	0.39	0.39
query32	3.25	0.46	0.47
query33	2.99	3.03	3.07
query34	17.13	4.47	4.41
query35	4.48	4.47	4.41
query36	0.67	0.48	0.47
query37	0.08	0.06	0.06
query38	0.04	0.03	0.03
query39	0.03	0.02	0.02
query40	0.16	0.12	0.13
query41	0.07	0.02	0.02
query42	0.03	0.03	0.02
query43	0.03	0.03	0.02
Total cold run time: 106.01 s
Total hot run time: 32.62 s

@freemandealer
Copy link
Contributor Author

run cloud_p0

Signed-off-by: freemandealer <[email protected]>
@freemandealer
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

TPC-H: Total hot run time: 41512 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit b8e12301562faf64063402ef95381cda46903ae0, data reload: false

------ Round 1 ----------------------------------
q1	17577	7684	7343	7343
q2	2052	174	173	173
q3	10595	1167	1236	1167
q4	10223	829	876	829
q5	7753	3280	3045	3045
q6	238	149	148	148
q7	1004	610	598	598
q8	9364	2031	2111	2031
q9	6620	6474	6453	6453
q10	7066	2463	2422	2422
q11	459	247	256	247
q12	407	212	211	211
q13	17798	3005	3033	3005
q14	253	221	217	217
q15	576	519	522	519
q16	653	583	581	581
q17	1006	582	499	499
q18	7322	6711	6708	6708
q19	1323	1057	941	941
q20	484	175	185	175
q21	4046	3250	3209	3209
q22	1112	991	1012	991
Total cold run time: 107931 ms
Total hot run time: 41512 ms

----- Round 2, with runtime_filter_mode=off -----
q1	7352	7267	7277	7267
q2	333	230	224	224
q3	3093	3055	3070	3055
q4	2002	1797	1795	1795
q5	5748	5708	5753	5708
q6	233	141	143	141
q7	2251	1781	1800	1781
q8	3378	3630	3537	3537
q9	9014	9026	9024	9024
q10	3645	3600	3557	3557
q11	614	496	506	496
q12	816	622	625	622
q13	8343	3228	3047	3047
q14	298	275	264	264
q15	600	512	503	503
q16	695	616	620	616
q17	1898	1660	1626	1626
q18	8159	7663	7840	7663
q19	1748	1672	1598	1598
q20	2158	1883	1896	1883
q21	5399	5510	5398	5398
q22	1174	1042	1014	1014
Total cold run time: 68951 ms
Total hot run time: 60819 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 190963 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit b8e12301562faf64063402ef95381cda46903ae0, data reload: false

query1	1207	742	729	729
query2	6252	2089	2024	2024
query3	6528	212	217	212
query4	67863	29869	23476	23476
query5	5181	459	449	449
query6	373	167	167	167
query7	5366	295	300	295
query8	314	223	218	218
query9	7616	2623	2611	2611
query10	409	252	249	249
query11	16723	15333	15332	15332
query12	155	114	114	114
query13	1322	463	413	413
query14	10469	6842	6595	6595
query15	210	178	171	171
query16	7085	462	466	462
query17	1101	549	565	549
query18	1818	293	302	293
query19	198	156	149	149
query20	112	110	109	109
query21	204	101	103	101
query22	4548	4447	4307	4307
query23	34611	34104	33984	33984
query24	6019	2734	2771	2734
query25	511	400	402	400
query26	692	165	157	157
query27	1750	277	294	277
query28	4211	2468	2423	2423
query29	684	424	427	424
query30	234	153	155	153
query31	1003	802	832	802
query32	72	55	57	55
query33	484	278	280	278
query34	910	511	520	511
query35	868	717	744	717
query36	1069	958	924	924
query37	118	68	81	68
query38	4422	4208	4214	4208
query39	1466	1403	1434	1403
query40	204	102	103	102
query41	47	46	52	46
query42	112	97	99	97
query43	542	489	492	489
query44	1162	826	817	817
query45	183	174	168	168
query46	1119	686	739	686
query47	1980	1892	1847	1847
query48	417	323	325	323
query49	732	391	393	391
query50	829	395	381	381
query51	7358	7160	7134	7134
query52	98	88	93	88
query53	250	181	181	181
query54	525	397	397	397
query55	78	74	78	74
query56	265	244	236	236
query57	1264	1212	1137	1137
query58	220	197	198	197
query59	3124	3088	2927	2927
query60	269	238	239	238
query61	100	102	120	102
query62	786	653	691	653
query63	215	201	190	190
query64	1681	616	597	597
query65	3283	3188	3179	3179
query66	734	305	294	294
query67	16050	15780	15626	15626
query68	3460	564	561	561
query69	409	269	251	251
query70	1200	1092	1114	1092
query71	343	249	228	228
query72	6356	4030	3951	3951
query73	782	356	357	356
query74	9344	8892	8942	8892
query75	3383	2677	2686	2677
query76	1710	1067	1080	1067
query77	488	271	273	271
query78	10344	9402	9399	9399
query79	1696	600	584	584
query80	854	413	407	407
query81	512	240	235	235
query82	1276	113	112	112
query83	157	137	138	137
query84	277	68	72	68
query85	854	296	275	275
query86	311	310	293	293
query87	4789	4707	4666	4666
query88	3583	2212	2159	2159
query89	397	293	286	286
query90	2079	184	182	182
query91	136	99	97	97
query92	59	46	49	46
query93	1083	521	526	521
query94	749	275	297	275
query95	336	246	243	243
query96	620	276	280	276
query97	2855	2732	2727	2727
query98	215	196	194	194
query99	1604	1299	1295	1295
Total cold run time: 310066 ms
Total hot run time: 190963 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 31.68 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit b8e12301562faf64063402ef95381cda46903ae0, data reload: false

query1	0.04	0.04	0.03
query2	0.07	0.03	0.04
query3	0.23	0.07	0.06
query4	1.65	0.10	0.10
query5	0.41	0.39	0.41
query6	1.13	0.65	0.65
query7	0.02	0.01	0.02
query8	0.03	0.03	0.03
query9	0.56	0.49	0.49
query10	0.55	0.54	0.53
query11	0.14	0.10	0.10
query12	0.14	0.11	0.10
query13	0.60	0.60	0.61
query14	2.82	2.72	2.77
query15	0.89	0.83	0.82
query16	0.39	0.38	0.36
query17	1.03	1.07	1.05
query18	0.23	0.23	0.22
query19	1.87	1.86	2.00
query20	0.01	0.02	0.00
query21	15.75	0.59	0.56
query22	2.68	2.71	1.55
query23	16.98	1.07	0.84
query24	3.06	0.45	1.93
query25	0.27	0.07	0.17
query26	0.42	0.13	0.14
query27	0.05	0.04	0.05
query28	10.72	1.10	1.07
query29	12.53	3.21	3.18
query30	0.25	0.07	0.06
query31	2.88	0.37	0.38
query32	3.26	0.46	0.46
query33	3.00	3.04	3.05
query34	16.87	4.43	4.49
query35	4.53	4.52	4.52
query36	0.66	0.47	0.50
query37	0.09	0.06	0.06
query38	0.04	0.04	0.03
query39	0.03	0.02	0.02
query40	0.16	0.12	0.13
query41	0.08	0.02	0.02
query42	0.04	0.02	0.02
query43	0.03	0.02	0.02
Total cold run time: 107.19 s
Total hot run time: 31.68 s

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 37.81% (9821/25973)
Line Coverage: 28.99% (81667/281714)
Region Coverage: 28.23% (42106/149155)
Branch Coverage: 24.80% (21356/86110)
Coverage Report: http://coverage.selectdb-in.cc/coverage/b8e12301562faf64063402ef95381cda46903ae0_b8e12301562faf64063402ef95381cda46903ae0/report/index.html

@@ -86,6 +86,94 @@ BlockFileCache::BlockFileCache(const std::string& cache_base_path,
_total_evict_size_metrics = std::make_shared<bvar::Adder<size_t>>(
_cache_base_path.c_str(), "file_cache_total_evict_size");

_evict_by_heat_metrics_matrix[FileCacheType::DISPOSABLE][FileCacheType::NORMAL] =
std::make_shared<bvar::Adder<size_t>>(_cache_base_path.c_str(),
"file_cache_evict_by_heat_disposable_to_normal");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"file_cache_evict_by_heat" -> "file_cache_evict_by_time"

@@ -109,14 +197,16 @@ BlockFileCache::BlockFileCache(const std::string& cache_base_path,
"file_cache_hit_ratio_5m", 0.0);
_hit_ratio_1h = std::make_shared<bvar::Status<double>>(_cache_base_path.c_str(),
"file_cache_hit_ratio_1h", 0.0);
_disk_limit_mode_metrics =
std::make_shared<bvar::Status<size_t>>(_cache_base_path.c_str(), "disk_limit_mode", 0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"disk_limit_mode" -> "file_cache_disk_limit_mode"

Copy link
Contributor

github-actions bot commented Nov 4, 2024

PR approved by at least one committer and no changes requested.

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Nov 4, 2024
Copy link
Contributor

github-actions bot commented Nov 4, 2024

PR approved by anyone and no changes requested.

@gavinchou gavinchou merged commit dacba03 into apache:master Nov 4, 2024
26 of 31 checks passed
freemandealer added a commit to freemandealer/doris that referenced this pull request Nov 4, 2024
- Enhance cache performance and reduce cache misses by:
    - Prevent starvation of any particular cache.
    - Improve disk space utilization.
    - Maintain strict and systematic eviction priorities.
- Enhance the observability of caching strategies, allowing cache
behavior to be intuitively self-explanatory through monitoring.
- Improve code comprehensibility: unify the cache framework to avoid
ad-hoc handling of TTL, increasing the modularity of the code.
- Reduce operational complexity by eliminating and standardizing
configuration items.

---------

Signed-off-by: freemandealer <[email protected]>
dataroaring pushed a commit that referenced this pull request Nov 4, 2024
…43201)

- Enhance cache performance and reduce cache misses by:
    - Prevent starvation of any particular cache.
    - Improve disk space utilization.
    - Maintain strict and systematic eviction priorities.
- Enhance the observability of caching strategies, allowing cache
behavior to be intuitively self-explanatory through monitoring.
- Improve code comprehensibility: unify the cache framework to avoid
ad-hoc handling of TTL, increasing the modularity of the code.
- Reduce operational complexity by eliminating and standardizing
configuration items.

Signed-off-by: freemandealer <[email protected]>
@gavinchou gavinchou added cir and removed approved Indicates a PR has been approved by one committer. labels Nov 11, 2024
@gavinchou gavinchou mentioned this pull request Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants