Multi-threading writing to multiple distributed tables in a DolphinDB database

Viewed 21

I tried to conduct concurrent writes in DolphinDB and set enableChunkGranularityConfig = true. I have three tables, oq, mk, ts, all under the 1db3tb database. I want to write data to these tables and test the concurrent performance. How to write a dos command to conduct concurrent writes?

I created a dos file as follows, but it seems still single-threaded. How can I append data to the tables at the same time? tableObj1.append!(t1) tableObj2.append!(t2) tableObj3.append!(t3)

1 Answers

You can refer to the following script:

def writeData(dbName, tableName, data){
    timer loadTable(dbName, tableName, data){
}
submitJob("write1", "write data", writeData, dbName, tableName1, data1)
submitJob("write2", "write data", writeData, dbName, tableName1, data2)
submitJob("write3", "write data", writeData, dbName, tableName1, data2)
getRecentJobs()
Related