dascalos
dascalos

Reputation: 509

Azure Web Jobs architecture

I have some code that needs to run as a result of a call to a service bus. This particular code is CPU intensive and it is possible that 100s of these will need to run at the same time. Does Azure Web Jobs use computing resources from one machine, or does it use any available computing resources from several machines?

Upvotes: 5

Views: 1382

Answers (3)

Karthikeyan VK
Karthikeyan VK

Reputation: 6006

Web Jobs uses your web app resources, why don't you try the Azure Functions which can be scaled and their pricing is almost zero. They are in Technical preview i have tried using it, Azure functions is very cheap. If your service bus call can be out of process service meaning it does not need a instance results from your application you can try azure functions. Azure functions are mostly used for maintenance and night time running jobs. I have used it to minify my images to thumbnail. It worked perfectly fine

Upvotes: 1

Victor Hurdugaci
Victor Hurdugaci

Reputation: 28425

A web job deployed as part of an Azure WebSite will share the resources with the web application. You have the option to scale the website up to 10 (I think?) instances if you need parallelism.

As I mentioned in the comment to Matthew's post, if you use the Azure WebJobs SDK to have functions triggered by ServiceBus queue messages, we don't parallelize as part of the same host. This means that messages will be processed sequentially as long as you have a single host.

Upvotes: 0

Matthew Steeples
Matthew Steeples

Reputation: 8058

Azure Webjobs is designed to run on as many servers as you've scaled up the website to run on. By default it will run up to 16 tasks from a queue concurrently but this is configurable as shown here.

public class Program
{
    static void Main()
    {
        JobHostConfiguration config = new JobHostConfiguration();
        config.Queues.BatchSize= 1;
        JobHost host = new JobHost(config);
        host.RunAndBlock();
    }
}

Upvotes: 1

Related Questions