killxdcj opened a new issue #7214:
URL: https://github.com/apache/incubator-doris/issues/7214


   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/incubator-doris/issues?q=is%3Aissue) and 
found no similar issues.
   
   
   ### Description
   
   # Background
   
   DeltaWriter may encounter serious performance problems when write 
concurrency is high, such as the following case
   - There are a large number of insert-into-select tasks in the cluster
   - When use BrokerLoad to load  large quantities of data with high concurrency
   
   The following is a flame graph of a cluster which contains a large number of 
insert-into-select tasks
   
   
![image](https://user-images.githubusercontent.com/8370710/143372679-60f85e9c-9f00-416f-b3f9-9a053f046ca7.png)
   
   The following is a flame graph when  executing brokerload. The parallel of 
brokerload is set to 4, data to load: 200GB, 40 billion
   
   
![image](https://user-images.githubusercontent.com/8370710/143372918-ebeae67a-f175-4a8f-8a2f-694b987a1b7b.png)
   
   # Solution
   
   - When writing data to the DeltaWriter, group the data by tablet first and 
then write in batch, which can greatly reduce the lock/unlock operation
   
   - Use mutex instead of SpinLock, because DeltaWriter.write is not a 
lightweight operation(It may hold the lock for a long time), using SpinLock 
while consumes too much CPU when the write concurrency is high
   
   
   ### Use case
   
   _No response_
   
   ### Related issues
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to