none
Filestream open slow in Azure App service RRS feed

  • Question

  • During initialization a web app opens several hundred JSON files from ~/App_Data. I open the files with isAsync=true and read with ReadAsync. There is a loop which creates an async Task for each file, followed by a subsequent loop which awaits each task.

    Since there is no OpenAsync, I can't await the Filestream constructor, and monitoring shows that it takes 100-200msec to create each task. Then all the reads complete in a burst lasting about 80msec, so the entire process takes around 90sec.

    If I subsequently re-read the same files, task creation is very fast and the whole process takes only about 80msec. This remains the case for at least an hour, but if I wait a day the operation will be slow again.

    Any suggestions on how to speed up the initial load? 

    Monday, August 13, 2018 5:04 PM

All replies

  • Hi PeterKLive,

    Since your question is more related to web, you could post a new thread in ASP.NET forum for suitable support.

    https://forums.asp.net/

    The CLR Forum discuss and ask questions about .NET Framework Base Classes (BCL) such as Collections, I/O, Regigistry, Globalization, Reflection. Also discuss all the other Microsoft libraries that are built on or extend the .NET Framework, including Managed Extensibility Framework (MEF), Charting Controls, CardSpace, Windows Identity Foundation (WIF), Point of Sale (POS), Transactions.

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, August 30, 2018 6:25 AM