Skip to content
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

[fix](BE) Fix inefficient problem in PriorTaskWorkerPool #37169

Merged
merged 1 commit into from
Jul 5, 2024

Conversation

platoneko
Copy link
Contributor

Proposed changes

In the original implementation of PriorTaskWorkerPool, although multiple threads were launched in the normal pool and high prior pool, only one thread was actually working in each pool (running normal_loop and high_prior_loop, respectively). This PR fixes this issue.

@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.

@platoneko
Copy link
Contributor Author

run buildall

Copy link
Contributor

github-actions bot commented Jul 2, 2024

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

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17735	4584	4344	4344
q2	2566	204	201	201
q3	11641	1174	1124	1124
q4	10590	824	801	801
q5	7843	2701	2667	2667
q6	235	148	145	145
q7	968	621	632	621
q8	9531	2114	2076	2076
q9	8906	6484	6450	6450
q10	9003	3737	3737	3737
q11	443	241	244	241
q12	437	240	226	226
q13	18767	3016	3003	3003
q14	277	229	233	229
q15	517	475	487	475
q16	513	376	369	369
q17	972	718	652	652
q18	8189	7478	7333	7333
q19	3700	1445	1529	1445
q20	651	314	318	314
q21	4879	3208	3953	3208
q22	403	361	346	346
Total cold run time: 118766 ms
Total hot run time: 40007 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4374	4216	4211	4211
q2	387	272	273	272
q3	2977	2724	2749	2724
q4	1860	1676	1653	1653
q5	5266	5310	5312	5310
q6	222	131	132	131
q7	2149	1678	1770	1678
q8	3200	3337	3312	3312
q9	8382	8260	8396	8260
q10	3889	3668	3658	3658
q11	599	514	486	486
q12	778	643	583	583
q13	17525	2978	2950	2950
q14	302	285	263	263
q15	514	490	476	476
q16	471	424	422	422
q17	1767	1475	1485	1475
q18	7579	7465	7411	7411
q19	3081	1576	1520	1520
q20	2031	1750	1775	1750
q21	4881	4729	4792	4729
q22	608	542	523	523
Total cold run time: 72842 ms
Total hot run time: 53797 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 172508 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 17e7c8f67264b708552c4028474b03dcfc1db531, data reload: false

query1	903	384	374	374
query2	6465	2308	2323	2308
query3	6661	204	211	204
query4	19431	17333	17359	17333
query5	4168	474	499	474
query6	264	160	159	159
query7	4605	287	288	287
query8	315	282	284	282
query9	8602	2418	2414	2414
query10	620	329	290	290
query11	10506	10203	9873	9873
query12	159	81	82	81
query13	1629	368	356	356
query14	9416	6930	7254	6930
query15	225	182	188	182
query16	7667	273	259	259
query17	1474	555	519	519
query18	1937	272	266	266
query19	189	151	145	145
query20	85	83	82	82
query21	213	143	128	128
query22	4471	4075	4045	4045
query23	33464	32895	33107	32895
query24	11440	2873	2747	2747
query25	686	380	409	380
query26	1667	156	150	150
query27	2956	304	314	304
query28	7177	2081	2057	2057
query29	1024	620	610	610
query30	274	151	151	151
query31	985	727	754	727
query32	91	52	56	52
query33	773	283	282	282
query34	972	455	469	455
query35	740	611	621	611
query36	1103	931	927	927
query37	151	101	74	74
query38	2844	2740	2762	2740
query39	873	798	789	789
query40	278	128	122	122
query41	52	52	53	52
query42	124	96	100	96
query43	604	566	552	552
query44	1301	727	729	727
query45	190	159	162	159
query46	1064	701	690	690
query47	1871	1759	1770	1759
query48	363	287	296	287
query49	1154	407	411	407
query50	766	381	381	381
query51	6855	6798	6783	6783
query52	104	95	91	91
query53	367	278	283	278
query54	1016	439	440	439
query55	80	73	76	73
query56	288	269	299	269
query57	1132	1055	1048	1048
query58	241	238	263	238
query59	3615	3162	3133	3133
query60	299	276	287	276
query61	94	89	91	89
query62	657	440	449	440
query63	324	286	288	286
query64	9854	2316	1770	1770
query65	3159	3128	3085	3085
query66	1418	333	327	327
query67	15599	14972	14965	14965
query68	4540	518	537	518
query69	464	316	311	311
query70	1159	1147	1100	1100
query71	386	287	282	282
query72	7286	5600	5603	5600
query73	737	321	321	321
query74	5940	5488	5463	5463
query75	3391	2678	2685	2678
query76	2772	1013	946	946
query77	490	303	307	303
query78	10333	9870	9689	9689
query79	2204	509	514	509
query80	966	478	462	462
query81	549	220	221	220
query82	682	106	106	106
query83	239	168	164	164
query84	239	85	83	83
query85	1984	274	265	265
query86	510	299	270	270
query87	3254	3088	3077	3077
query88	4029	2358	2353	2353
query89	465	365	374	365
query90	1845	194	190	190
query91	124	99	100	99
query92	61	52	51	51
query93	2467	501	502	501
query94	1244	184	187	184
query95	398	368	308	308
query96	589	271	267	267
query97	3151	3069	3024	3024
query98	217	201	201	201
query99	1250	838	834	834
Total cold run time: 274059 ms
Total hot run time: 172508 ms

@doris-robot
Copy link

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

query1	0.04	0.03	0.03
query2	0.08	0.03	0.04
query3	0.23	0.06	0.06
query4	1.67	0.07	0.08
query5	0.50	0.49	0.48
query6	1.14	0.72	0.72
query7	0.02	0.01	0.01
query8	0.06	0.05	0.04
query9	0.54	0.50	0.50
query10	0.54	0.55	0.56
query11	0.17	0.12	0.11
query12	0.15	0.12	0.12
query13	0.59	0.58	0.59
query14	0.81	0.77	0.79
query15	0.84	0.81	0.82
query16	0.36	0.34	0.37
query17	1.00	0.97	0.97
query18	0.22	0.26	0.23
query19	1.86	1.70	1.68
query20	0.02	0.01	0.01
query21	15.45	0.75	0.65
query22	4.35	6.39	2.55
query23	18.27	1.32	1.29
query24	2.04	0.24	0.22
query25	0.16	0.08	0.08
query26	0.26	0.17	0.17
query27	0.08	0.08	0.08
query28	13.27	1.02	1.00
query29	12.67	3.28	3.27
query30	0.25	0.05	0.07
query31	2.87	0.39	0.39
query32	3.28	0.46	0.46
query33	2.90	2.88	2.88
query34	17.10	4.44	4.41
query35	4.50	4.47	4.51
query36	0.65	0.48	0.47
query37	0.18	0.15	0.16
query38	0.15	0.15	0.14
query39	0.04	0.04	0.03
query40	0.18	0.15	0.15
query41	0.08	0.05	0.05
query42	0.05	0.05	0.04
query43	0.04	0.04	0.04
Total cold run time: 109.66 s
Total hot run time: 31.15 s

@platoneko
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17627	4382	4275	4275
q2	2026	194	193	193
q3	10506	1233	1134	1134
q4	10208	850	844	844
q5	7480	2659	2677	2659
q6	223	140	142	140
q7	959	597	607	597
q8	9243	2086	2072	2072
q9	8738	6482	6464	6464
q10	9017	3703	3718	3703
q11	447	238	238	238
q12	415	233	232	232
q13	18774	2990	3005	2990
q14	279	223	229	223
q15	528	481	490	481
q16	512	373	387	373
q17	969	688	696	688
q18	8053	7515	7493	7493
q19	8131	1538	1324	1324
q20	661	328	330	328
q21	4869	3208	3228	3208
q22	388	340	341	340
Total cold run time: 120053 ms
Total hot run time: 39999 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4390	4264	4245	4245
q2	366	267	258	258
q3	3071	2912	2898	2898
q4	1994	1762	1769	1762
q5	5616	5551	5498	5498
q6	243	137	137	137
q7	2394	1934	1876	1876
q8	3335	3477	3419	3419
q9	8736	8920	8721	8721
q10	4101	3711	3829	3711
q11	584	483	495	483
q12	864	644	625	625
q13	16274	3201	3207	3201
q14	298	291	264	264
q15	539	483	485	483
q16	507	454	427	427
q17	1849	1527	1465	1465
q18	8135	8013	7739	7739
q19	1805	1604	1616	1604
q20	2565	1860	1838	1838
q21	5173	4995	4730	4730
q22	632	553	554	553
Total cold run time: 73471 ms
Total hot run time: 55937 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 175277 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 17e7c8f67264b708552c4028474b03dcfc1db531, data reload: false

query1	923	383	366	366
query2	6461	2452	2345	2345
query3	6637	210	209	209
query4	20713	17583	17450	17450
query5	3723	473	477	473
query6	267	175	173	173
query7	4595	294	297	294
query8	314	298	275	275
query9	8506	2404	2380	2380
query10	555	295	269	269
query11	10772	10284	10265	10265
query12	116	90	82	82
query13	1630	357	354	354
query14	8666	7672	7426	7426
query15	228	186	183	183
query16	7800	256	259	256
query17	1924	537	508	508
query18	1971	266	265	265
query19	190	166	149	149
query20	89	80	81	80
query21	215	130	131	130
query22	4656	4310	4342	4310
query23	33900	33501	33536	33501
query24	10451	2891	2865	2865
query25	610	374	373	373
query26	721	154	150	150
query27	2251	324	315	315
query28	5919	2136	2138	2136
query29	892	642	653	642
query30	244	164	155	155
query31	1029	757	757	757
query32	98	57	54	54
query33	647	302	284	284
query34	878	469	476	469
query35	712	668	611	611
query36	1132	971	1001	971
query37	135	75	81	75
query38	2946	2820	2856	2820
query39	924	837	815	815
query40	236	131	142	131
query41	60	57	54	54
query42	115	119	106	106
query43	596	536	555	536
query44	1080	745	731	731
query45	207	168	171	168
query46	1071	709	725	709
query47	1878	1813	1801	1801
query48	371	316	297	297
query49	847	447	413	413
query50	762	379	381	379
query51	6769	6777	6785	6777
query52	98	89	88	88
query53	351	286	283	283
query54	875	435	441	435
query55	73	73	75	73
query56	289	271	257	257
query57	1124	1070	1075	1070
query58	261	239	244	239
query59	3298	3180	3105	3105
query60	321	274	276	274
query61	95	91	93	91
query62	606	446	442	442
query63	323	294	289	289
query64	8569	2264	1749	1749
query65	3165	3065	3063	3063
query66	744	320	322	320
query67	15521	15120	15035	15035
query68	4516	520	533	520
query69	452	305	306	305
query70	1182	1107	1150	1107
query71	347	278	276	276
query72	7031	5831	5730	5730
query73	728	326	324	324
query74	6077	5618	5529	5529
query75	3357	2717	2655	2655
query76	2162	941	998	941
query77	420	297	302	297
query78	10632	9841	9777	9777
query79	2378	524	508	508
query80	2238	478	495	478
query81	611	219	222	219
query82	782	116	112	112
query83	291	172	174	172
query84	261	89	90	89
query85	1582	337	321	321
query86	471	330	291	291
query87	3274	3100	3084	3084
query88	3479	2368	2348	2348
query89	477	381	369	369
query90	1736	189	191	189
query91	139	111	113	111
query92	60	49	51	49
query93	2298	504	494	494
query94	1120	196	196	196
query95	405	317	320	317
query96	596	265	268	265
query97	3185	3024	3017	3017
query98	227	198	204	198
query99	1219	839	844	839
Total cold run time: 267878 ms
Total hot run time: 175277 ms

@doris-robot
Copy link

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

query1	0.04	0.03	0.03
query2	0.09	0.04	0.04
query3	0.23	0.05	0.06
query4	1.64	0.09	0.09
query5	0.50	0.50	0.49
query6	1.12	0.72	0.72
query7	0.03	0.02	0.01
query8	0.05	0.04	0.05
query9	0.55	0.49	0.48
query10	0.54	0.55	0.55
query11	0.15	0.11	0.12
query12	0.16	0.12	0.11
query13	0.60	0.58	0.57
query14	0.77	0.77	0.78
query15	0.84	0.81	0.82
query16	0.37	0.37	0.36
query17	0.97	0.94	0.93
query18	0.23	0.27	0.23
query19	1.79	1.65	1.65
query20	0.01	0.01	0.01
query21	15.45	0.74	0.67
query22	4.18	6.30	2.57
query23	18.29	1.33	1.39
query24	2.18	0.24	0.22
query25	0.15	0.08	0.09
query26	0.28	0.18	0.17
query27	0.08	0.08	0.08
query28	13.24	1.01	0.99
query29	12.67	3.25	3.23
query30	0.25	0.06	0.05
query31	2.86	0.39	0.39
query32	3.27	0.47	0.46
query33	2.85	2.91	2.87
query34	17.08	4.40	4.41
query35	4.46	4.46	4.45
query36	0.65	0.46	0.48
query37	0.19	0.16	0.15
query38	0.16	0.15	0.15
query39	0.04	0.04	0.03
query40	0.17	0.16	0.14
query41	0.09	0.06	0.05
query42	0.06	0.04	0.04
query43	0.04	0.04	0.04
Total cold run time: 109.37 s
Total hot run time: 31.07 s

Copy link
Contributor

github-actions bot commented Jul 5, 2024

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

@github-actions github-actions bot added approved Indicates a PR has been approved by one committer. reviewed labels Jul 5, 2024
Copy link
Contributor

github-actions bot commented Jul 5, 2024

PR approved by anyone and no changes requested.

Copy link
Contributor

@dataroaring dataroaring left a comment

Choose a reason for hiding this comment

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

LGTM

@dataroaring dataroaring merged commit dbf963c into apache:master Jul 5, 2024
26 of 30 checks passed
dataroaring pushed a commit that referenced this pull request Jul 17, 2024
## Proposed changes

In the original implementation of `PriorTaskWorkerPool`, although
multiple threads were launched in the normal pool and high prior pool,
only one thread was actually working in each pool (running `normal_loop`
and `high_prior_loop`, respectively). This PR fixes this issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by one committer. dev/3.0.1-merged reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants