Reputation: 1775
Fellow coders,
I know this question is not exactly about programming, feel free to close this issue and point me to the correct Forum if SO is not the appropriate place for it.
I have developped a .NET Core 3.1 App, deployed on Azure App Service, but I face a performance issue.
The service consists of an OCR Analysis of various files, the OCR part being performed by an external library embedded into a DLL. On my laptop, when running the service locally, the OCR Part (one line of code, no I/O, nothing else being performed) takes between one and two seconds. It takes a big chunk of the available CPU though.
For the exact same file being processed, and monitoring the exact same line of code, the computation takes 6 to 8 seconds when running online on Azure, with no other request being processed. The App is deployed on Azure Web App, S1 Production Plan (100 ACU, around 60 $/month). With the number of users increasing, the overall response time is increasing as well and this compromises the performance of the entire system.
Before I start switching Plans and spending my customer's money, I would like to make sure that I am not missing something important on how to chose a Web App Plan.
Thanks for your help,
Upvotes: 3
Views: 4289
Reputation: 181
Based on this documentation https://azure.microsoft.com/en-us/pricing/details/app-service/linux/, the S1 plan has 1 CPU core and 1.75 GB RAM, and I guess this is the reason why on the cloud is taking more time even if the metrics show that the CPU peek only to 50/60%.
For better performance, Microsoft indicates to use PremiumV2 plans ( and now are also available the premium V3), but in your case, I suggest you scale up your plan to S2 and profile the application, then scale up to S3 and so on...
Upvotes: 1
Reputation: 13399
Generally you never want a web request to take as long as 6-8 seconds, you need to be thinking about a different architecture ideally rather than beefing up your server.
Your best fit for a relatively quick refactor may well be a combo of azure storage blobs plus a blob storage triggered azure function which does the processing, you should be able to move your code to the azure function. The web site would then just deal with the upload and would return immediately, ideally with some kind of ID that the client could use to check the document status. Other event based mechanisms are also available if you don’t want the client to have to check the status manually.
Upvotes: 1