2

I have a very small website that almost do nothing by now, and we are implementing webjobs to do sometime-heavy background things like loading and processing information that needs to be filtered and prepared to then be showed at the web.

Everything is perfect when running in debug mode from our machine. The same code also run perfect and with high performance if I put the same code in an app and then run from an Azure Virtual Machine.

But, when playing with Azure Webjobs the Webjob process never uses more than 5% of the CPU available. No matter what I do. I already try to change the job configuration, by modifying batch size and NewBatchThreshold but nothing change. The problem is not on the way Azure interacts with the queue but on some processing restrictions after that.

My ideal escenario for CPU usage in the future would be:

  • 10% assigned to the website
  • 90% divided into two separate webjobs

The problem that scenario now looks impossible as I'm being restricted to something like from 3.5% to 5% of CPU usage on the webjob.

Any ideas?

Thanks!

fernaramburu
  • 151
  • 1
  • 8
  • 1
    are you running multiple cores? i could be wrong but i think a webjob is limited to only one core, so if you're running on a 4 cores instance, a single webjob will not exceed 25% of total CPU utilization, you would have to deploy 4 of the same webjob on a 4 cores instance to be able to utilize all 4 cores, someone please correct me if i'm wrong though – Minh Nguyen Apr 15 '16 at 21:15
  • @minwyn Thanks for the comment. Interesting what you are saying but I was running on a single core instance to see if that was the issue, but the thing is that never goes up more than 5%. I even define a test rule to scale if CPU goes over 10% and it never scale up in a single core instance. I was thinking on deploying multiple instances of the same task by creating multiple webjobs but didn't sound like a good practice, or at least a practice I like as a feature. – fernaramburu Apr 17 '16 at 22:50
  • 1
    @femaramburu i agree that deploying multiple of the same webjob doesn't sounds like good practice, there is already a request to improve webjob to be able to run on multiple cores, see here https://feedback.azure.com/forums/169385-web-apps-formerly-websites/suggestions/7454605-webjobs-better-scalability-support-needed – Minh Nguyen Apr 19 '16 at 01:17
  • Are you using Async-Await pattern in you webjob functions? my webjobs interact with the storage account quite a bit (queues, tables blobs) and they seemed to spend most of the time reading/writing things from/to the storage account. Switching my functions to async improved the overall performance significantly and the CPU usage wen significantly up too... – Rafal Zajac Jul 05 '16 at 15:26
  • @RafalZajac Yes. I'm using await pattern. The webjobs interacts a lot with storage but using just 5% of the cpu sounds like too small. Thanks anyway. – fernaramburu Jul 06 '16 at 23:01

0 Answers0