Querying disk usage without impacting the performance
I have an application which allows users to upload files. These files can be uploaded via browser or any tool for bulk uploadin开发者_JS百科g. I need to monitor the storage where files are actually being stored and prevent uploading if storage reaches a certain threshold.
But the API available to query disk usage on network share is an unmanaged call which could be costly and will result in slow performance.
Should I make these calls asycn? (If yes, should I do this using dedicated thread or a thread from threadpool?) Should I not get usage stats on each request? (Which is acceptable but how should I manage this?)
精彩评论