Does having many triggers (blob, servicebus,timer) in a single webjob will reduce the performance of webjob?
Is there any way to improve performance of webjob with many triggers?
Can a heavy weight webjob be divided into smaller weight webjob?

- 13
- 3
-
What have you tried so far? Did you already measured something? – Peter Bons Dec 27 '18 at 12:20
-
@Peter Yes, I measured the performance through load test and seems like performance is degrading as user count gets increased. What could be the reason for this? Is it because webjob is bulky? What is the best practice to have webjob like this. – Namrata Rawool Dec 27 '18 at 12:39
-
It depends on what it does and how it does that. Can you share some relevant code? You might be able to split the webjob into multiple azure functions, each having their own trigger. – Peter Bons Dec 27 '18 at 12:46
2 Answers
Regard to Azure WebJobs as a feature of Azure App Service to run background job as the offical document said below.
WebJobs is a feature of Azure App Service that enables you to run a program or script in the same context as a web app, API app, or mobile app. There is no additional cost to use WebJobs.
Althought it said no additional cost
, WebJob as a simple and useful feature was founded before Azure published other similar and more powerful services, which like Functions be introduced in the same doc as below.
Azure Functions provides another way to run programs and scripts. For a comparison between WebJobs and Functions, see Choose between Flow, Logic Apps, Functions, and WebJobs.
In the reference document above, the Summary
section recommend its best application scenario.
Summary
Azure Functions offers greater developer productivity, more programming language options, more development environment options, more Azure service integration options, and more pricing options. For most scenarios, it's the best choice.
Here are two scenarios for which WebJobs may be the best choice:
- You need more control over the code that listens for events, the JobHost object. Functions offers a limited number of ways to customize JobHost behavior in the host.json file. Sometimes you need to do things that can't be specified by a string in a JSON file. For example, only the WebJobs SDK lets you configure a custom retry policy for Azure Storage.
- You have an App Service app for which you want to run code snippets, and you want to manage them together in the same DevOps environment.
For other scenarios where you want to run code snippets for integrating Azure or third-party services, choose Azure Functions over WebJobs with the WebJobs SDK.
Meanwhile, per my experience on Azure, WebJobs and Functions are only suitable for some simple and light-weight task job. For high performance requirement, Azure Batch service is a good choice to get the balance between cost and ease of use.

- 23,476
- 4
- 25
- 43
1. Does having many triggers (blob, servicebus,timer) in a single webjob will reduce the performance of webjob? Provided that your webjob is not singleton. You can have multiple functions in your webjob with multiple triggers and the performance will not reduce. (provided your webapp plan is beefy enough to handle all the load.)
2.Is there any way to improve performance of webjob with many triggers? - the best way would be to divide the webjob into smaller webjobs and each webjob having a single trigger. And scale your webjobs out (add more instances) based on load. Also in case your webjob executes within 5 mins you can also choose to use Azure Function App. Which gives a much better option. Alternatively, assuming the webjob execution takes more than 5 mins you can have your webjob exe as a docker image and provision them using logic app on demand using ACI. In this scenario you will be configuring the triggers in logic app.
1. Can a heavy weight webjob be divided into smaller weight webjob? - yes, see my previous answers.

- 337
- 2
- 10
-
You are welcome. Please feel free to ask, if you have any more queries. – Tiklu Ganguly Jan 11 '19 at 15:39
-
I have 3 different background tasks running in my application, say 1 in every 5 mins, 1 every hour, and one at a specific time of day. is it possible to add multiple timer triggers to a single web job or do i need to create 3 different web jobs to achieve this? – Nikheel Nov 12 '20 at 15:06
-
I would suggest that you create 3 logic app with different timer triggers and via the logic app call your web job. according to me, this is more configurable as, if you need to change the timer in the future you can do it via the logic app and you don't really need to deploy any code. This definitely works well. – Tiklu Ganguly Nov 17 '20 at 18:25