Skip to content

Conversation

@morningman
Copy link
Contributor

bp #50357

Problem Summary:

After query finished, the audit event will be created and:
1. Try to put into `queryAuditEventList` in `WorkloadRuntimeStatusMgr`

`WorkloadRuntimeStatusMgr` has a background thread to visit
`queryAuditEventList`, try to wait for
the statistic info of the event(such as scan rows, cpu time, etc.)
before logging this event.

The size of `queryAuditEventList` is very large, default is `250000`,
which is configured by FE config
`audit_event_log_queue_size`. So that it can always hold all events
within a certain period (typically, 5 seconds).

2. If `queryAuditEventList` is full, the statistic info of this audit
event will be ignored, and event will be logged directly.

Either the event has the statistic info or not, it will be put into a
`eventQueue` in `AuditEventProcessor`.
But this queue only has capacity of `10000`, which may not enough to
cache all events in a certain periods.
So some of audit event will be discarded and lost.

This PR mainly changes:
1. Use the same config `audit_event_log_queue_size` as the max size of
`eventQueue`.
2. Change some log message for easy debugging in future.
@morningman morningman requested a review from dataroaring as a code owner April 29, 2025 06:34
@Thearas
Copy link
Contributor

Thearas commented Apr 29, 2025

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

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@morningman
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17556	7051	6581	6581
q2	2067	180	188	180
q3	10623	1081	1188	1081
q4	10555	736	751	736
q5	7762	2881	2835	2835
q6	219	134	132	132
q7	994	628	610	610
q8	9589	1892	2014	1892
q9	6957	6361	6381	6361
q10	7034	2268	2268	2268
q11	464	256	252	252
q12	392	208	212	208
q13	17784	3017	2990	2990
q14	230	214	202	202
q15	500	467	473	467
q16	655	597	598	597
q17	990	567	603	567
q18	7632	6862	6946	6862
q19	1392	1066	996	996
q20	472	198	201	198
q21	3929	3299	3207	3207
q22	1092	1003	997	997
Total cold run time: 108888 ms
Total hot run time: 40219 ms

----- Round 2, with runtime_filter_mode=off -----
q1	6600	6584	6622	6584
q2	326	240	230	230
q3	2893	2850	2945	2850
q4	2024	1740	1833	1740
q5	5778	5745	5698	5698
q6	210	125	129	125
q7	2225	1789	1866	1789
q8	3344	3486	3557	3486
q9	8759	8865	8779	8779
q10	3527	3501	3492	3492
q11	613	495	503	495
q12	840	613	612	612
q13	11082	3231	3149	3149
q14	324	288	271	271
q15	513	465	459	459
q16	692	672	655	655
q17	1856	1612	1604	1604
q18	8268	7617	7720	7617
q19	1692	1597	1455	1455
q20	2044	1837	1883	1837
q21	5618	5359	5334	5334
q22	1137	1069	1045	1045
Total cold run time: 70365 ms
Total hot run time: 59306 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 197715 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 8b2d623b33ce3a10065cdfcabb7e945306168d9d, data reload: false

query1	1306	903	920	903
query2	6317	1940	1930	1930
query3	10825	4599	4390	4390
query4	61434	29335	23861	23861
query5	5140	474	466	466
query6	414	181	185	181
query7	5473	302	317	302
query8	321	230	220	220
query9	8598	2583	2575	2575
query10	467	309	253	253
query11	17718	15516	15997	15516
query12	151	103	105	103
query13	1402	448	430	430
query14	10540	7333	7424	7333
query15	194	187	172	172
query16	7134	472	509	472
query17	1192	587	594	587
query18	1950	335	315	315
query19	208	169	156	156
query20	118	108	111	108
query21	217	104	106	104
query22	4695	4471	4648	4471
query23	34621	34061	33999	33999
query24	6157	2899	2925	2899
query25	530	413	419	413
query26	674	168	166	166
query27	2086	348	350	348
query28	4306	2424	2419	2419
query29	667	444	430	430
query30	245	165	164	164
query31	1027	827	812	812
query32	71	56	57	56
query33	436	279	290	279
query34	925	499	513	499
query35	870	724	740	724
query36	1080	957	932	932
query37	121	64	70	64
query38	4063	3951	3911	3911
query39	1524	1654	1479	1479
query40	199	99	108	99
query41	46	51	46	46
query42	112	107	99	99
query43	534	480	491	480
query44	1169	818	808	808
query45	198	166	170	166
query46	1146	717	722	717
query47	2048	1895	1951	1895
query48	465	395	395	395
query49	732	399	405	399
query50	860	425	431	425
query51	7328	7166	7247	7166
query52	104	88	92	88
query53	263	199	208	199
query54	568	463	465	463
query55	80	76	81	76
query56	268	262	254	254
query57	1288	1187	1156	1156
query58	221	203	205	203
query59	3216	2995	2899	2899
query60	279	252	243	243
query61	120	112	117	112
query62	766	666	667	666
query63	218	188	190	188
query64	1405	677	635	635
query65	3231	3154	3187	3154
query66	711	294	320	294
query67	15982	15988	15567	15567
query68	4101	575	560	560
query69	433	264	259	259
query70	1141	1147	1048	1048
query71	348	262	257	257
query72	6326	4014	4101	4014
query73	757	335	341	335
query74	10508	8866	9061	8866
query75	3379	2636	2684	2636
query76	1988	1102	1139	1102
query77	517	264	273	264
query78	10625	9644	9614	9614
query79	2143	589	590	589
query80	1371	416	436	416
query81	529	240	236	236
query82	1268	88	86	86
query83	274	143	141	141
query84	284	80	74	74
query85	1020	294	287	287
query86	393	288	282	282
query87	4411	4288	4318	4288
query88	3764	2370	2347	2347
query89	414	291	286	286
query90	1992	184	183	183
query91	186	147	150	147
query92	64	49	50	49
query93	2697	547	544	544
query94	770	290	303	290
query95	349	251	247	247
query96	612	277	285	277
query97	3357	3175	3160	3160
query98	214	206	195	195
query99	1602	1306	1302	1302
Total cold run time: 316611 ms
Total hot run time: 197715 ms

@doris-robot
Copy link

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

query1	0.03	0.03	0.03
query2	0.07	0.04	0.03
query3	0.23	0.06	0.06
query4	1.63	0.10	0.10
query5	0.52	0.59	0.53
query6	1.14	0.73	0.73
query7	0.02	0.02	0.01
query8	0.04	0.02	0.03
query9	0.58	0.50	0.51
query10	0.56	0.55	0.55
query11	0.14	0.10	0.10
query12	0.14	0.12	0.10
query13	0.60	0.58	0.59
query14	2.87	2.73	2.75
query15	0.90	0.82	0.82
query16	0.38	0.39	0.39
query17	1.07	1.05	1.03
query18	0.24	0.22	0.22
query19	1.90	1.80	1.99
query20	0.02	0.00	0.01
query21	15.37	0.57	0.59
query22	3.01	2.06	2.42
query23	16.82	1.00	0.82
query24	3.35	1.23	1.34
query25	0.22	0.16	0.04
query26	0.43	0.13	0.12
query27	0.04	0.05	0.04
query28	9.63	0.56	0.52
query29	12.59	3.25	3.22
query30	0.25	0.06	0.06
query31	2.86	0.38	0.38
query32	3.25	0.46	0.45
query33	2.96	3.05	2.99
query34	17.06	4.57	4.49
query35	4.54	4.51	4.49
query36	0.68	0.49	0.49
query37	0.09	0.06	0.06
query38	0.04	0.03	0.04
query39	0.03	0.03	0.02
query40	0.16	0.14	0.13
query41	0.08	0.02	0.02
query42	0.04	0.02	0.02
query43	0.03	0.03	0.03
Total cold run time: 106.61 s
Total hot run time: 32.61 s

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 bcb6e68 into apache:branch-3.0 May 6, 2025
23 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants