โ06-01-2022 12:37 AM
Now, I write to Azure Data explorer using Spark streaming. one day๏ผ writes suddenly become slower. restart is no effect.
I have a questions about Spark Streaming to Azure Data explorer.
Q1: What should I do to get performance to reply?
Figure 1 shows the performance of writing in the current table.
Figure 2 the performance of writing in the now table.
Figure 3 the performance of writing in the current table, but the checkpoint location is new.
Could it be that checkpoint location caused it?
โ03-27-2023 07:18 PM
I'm so sorry, I just thought the issue wasn't resolved
Solution
Reason
for the first day, it processes larger files and then eventually process smaller filesใ
Detailed reason
Before performance drops๏ผ
1000 = (endOffset's index - startOffset's index) = ๏ผ80999- 79999๏ผ
1305389 = numInputRows
avg records per files is 1305389/1000 = 1305.389
After performance drops๏ผ1000 = (endOffset's index - startOffset's index) = ๏ผ90999- 89999๏ผ
45644= numInputRows
avg records per files is 45644/1000 = 45
From the comparison of (1) and (2), it can be seen that the number of files read by each batch before and after the performance drop (23:30) remains unchanged at 1000, but after 23:30 the number of 1000 total files changes. Less, it is most likely that the file size has become smaller, resulting in a smaller file, so the total number of read items has decreased. That is, for the first day, it processes larger files and then eventually processes smaller files.
Suggestion๏ผ
https://docs.microsoft.com/en-gb/azure/databricks/delta/delta-streaming#limit-input-rate
https://docs.microsoft.com/en-us/azure/databricks/delta/optimizations/auto-optimize
โ
โFinally, a big thank you to the Databricks team and the Microsoft team for their technical support.
โ06-01-2022 05:47 AM
if the checkpoint location is in another region or has another 'level' (think premium vs standard storage) that could be the case.
Can you check that?
โ06-02-2022 12:35 AM
Thank you for your answer.
I check it.
data source๏ผAdxDF๏ผ and checkpoint location is the same container, Only the path is different.
Azure Data Explorer and data source is the same region.
I have a new discovery.
โif I write to the new table. It's fast at first, and after a few hours of running, it suddenly slows down.
โI'll add a screenshot later
โ
โ06-05-2022 08:36 PM
Is it Blob storage or ADLS Storage account where your data and checkpoint files are stored?
โ06-05-2022 11:20 PM
It's Azure Data Lake Storage Gen2.
โ06-07-2022 04:21 AM
could it be the stream query that gets slow? Maybe checkpoint more often?
โ03-27-2023 07:22 PM
I'm very sorry to reply you now, this problem has been resolved, the specific reason is in another answer.
โ06-07-2022 06:42 PM
โ07-28-2022 05:35 PM
Do you have any more data to be process? check the driver logs for any errors messages? this suddenly drop might point to another issue happening here
โ03-27-2023 07:22 PM
I'm very sorry to reply you now, this problem has been resolved, the specific reason is in another answer.
โ03-27-2023 07:18 PM
I'm so sorry, I just thought the issue wasn't resolved
Solution
Reason
for the first day, it processes larger files and then eventually process smaller filesใ
Detailed reason
Before performance drops๏ผ
1000 = (endOffset's index - startOffset's index) = ๏ผ80999- 79999๏ผ
1305389 = numInputRows
avg records per files is 1305389/1000 = 1305.389
After performance drops๏ผ1000 = (endOffset's index - startOffset's index) = ๏ผ90999- 89999๏ผ
45644= numInputRows
avg records per files is 45644/1000 = 45
From the comparison of (1) and (2), it can be seen that the number of files read by each batch before and after the performance drop (23:30) remains unchanged at 1000, but after 23:30 the number of 1000 total files changes. Less, it is most likely that the file size has become smaller, resulting in a smaller file, so the total number of read items has decreased. That is, for the first day, it processes larger files and then eventually processes smaller files.
Suggestion๏ผ
https://docs.microsoft.com/en-gb/azure/databricks/delta/delta-streaming#limit-input-rate
https://docs.microsoft.com/en-us/azure/databricks/delta/optimizations/auto-optimize
โ
โFinally, a big thank you to the Databricks team and the Microsoft team for their technical support.
Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโt want to miss the chance to attend and share knowledge.
If there isnโt a group near you, start one and help create a community that brings people together.
Request a New Group