Question

I have Azure Worker Role and Web Role with ExtraSmall Instance.

I m passing Service Bus BrokeredMessage to update entity from Azure Web Role.

I just tested with updating entity, It took 5 seconds to reflect in the database for first three times. after that it took more than 30 seconds for each updates. I don't know why the performance is not consistent in Azure Worker Role? If Anybody knows Please share your thoughts.

I m sending and receiving messages synchronously.

Note: Worker role, I m connecting the database for each updates

Code sample WorkerRole class

public override void Run()
{
 while (true)
  {
   receivedmsg = CUDClient.Receive();
   UpdateProjectEntity(receivedmsg);
   Thread.Sleep(1000);
  }
}
private void UpdateProjectEntity (BrokeredMessage msg)
{       
  ProjectModel model = msg.GetBody<ProjectModel>();
  //connect federation database
  CrmEntities _db = Azure.ConnectCustomerEntity(model.ShardId);
  //update entities 
  ....
 }
Was it helpful?

Solution 2

This is basically Synchronous receive message, thats why slow. I converted in to Aynchronous Receive message, The performance is excellent. See the post here

Azure Worker Role Asynchronous Receive message: how long I should put the sleep for? (milliseconds)

OTHER TIPS

One reason might be that you share physical computer with 7 heavy instances. When they work a lot your instance gets slow. However,5 seconds to 30 seconds seems a lot. Can you upgrade to use an own instance, test again and then see if performance is more even?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top