Azure container instance (ACI) was very slow when creating tremendous small files on an azure file share disk mount point
Hi,
I created a linux azure container instance (aci), and mounted an azure file share disk to it in ARM when creating the ACI, the mount point was at "/mytest". The file share disk wasn't SSD, it's HDD, and it's "transaction-optimized" type.And then I have the following code to create tremendous small files in ACI.##### start
try:
os.makedirs(staging_path, exist_ok=True)
start_time1 = time.time()
for i in range(10000):
file_path = os.path.join(staging_path, f"file_{i}.txt")
with open(file_path, "w") as f:
f.write("abcdefghij") # 10 bytes of content
end_time1 = time.time()
total_time1 = end_time1 - start_time1
logger.log(ST_LOG, f"Total time to create 10,000 files: {total_time1:.2f} seconds")
except Exception as e:
logger.log(ST_ERROR, f"test: {e}")
##### end
It's very slow as the following for the file share disk mount point:
10/29 03:11:38 MSG "Total time to create 10,000 files: 602.12 seconds" - task_handler.py->process_unzip_request():117
But the interesting thing is, if I removed the mount point, and ran the above code in the disk allocated to ACI by default, which is 46 gb. The performance is very well as the following.
26 140221229517696 10/29 02:13:26 MSG "Total time to create 10,000 files: 0.75 seconds" - task_handler.py->process_unzip_request():117
Then my question: Why did the mounted file share disk so slow for above code? How to increase the default 46 gb allocated disk for ACI? Thanks.