Kentico 13 Scheduled Tasks Dynamic WebFarm

Matthew Butler asked on July 30, 2024 12:29

I've noticed in the documentation it mentions that some tasks are supposed to be duplicated to run on all servers. e.g. "Clean unused memory"

But when you have a dynamic webfarm, how do you set the "Server name" field? as this changes each time the web app is reset?

Thanks

Mat

Recent Answers


Juraj Ondrus answered on July 30, 2024 14:26

What do you mean by dynamic web farm?

0 votesVote for this answer Mark as a Correct answer

Matthew Butler answered on July 30, 2024 14:30

As in the web farm isn't in "Manual" mode, so it dynamically generates the name

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on July 30, 2024 14:39

Yes, but are you adding new servers dynamically somehow? Some auto-scaling? Moreover, most of the affected scheduled tasks are meant to be run on admin app - are you adding multiple admin app instances/servers?
If the web farm is in automatic mode and you have e.g. just one admin and one front end app in the list, that is OK. The task will be executed on that one admin and one front end app. The problem can arise when you have e.g. 3 admins in the web farm - in that case you need to ensure that the task is executed on each of them.
If you are using auto-scaling on Azure - the file system is shared for all the scaled-out instances.

0 votesVote for this answer Mark as a Correct answer

Matthew Butler answered on July 30, 2024 14:59

Sorry yes its in automatic mode, so one admin and one front end.

My understanding was by default the scheduled task would just run on the admin one.

Also that there are some tasks that need to be set to run on the front end one.

Is this the case? if so how is that achieved?

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on July 30, 2024 15:16

If you have one admin and one front end, no action needed. Whatever task needs to be executed and process something on the file system, it will be executed on that one admin and that one front end instance. Problem could be if you add more admins or front end apps - then you need to clone given tasks and set the server names. But still, in majority cases those additional instances are not dynamic. So, you can use web.config keys and set fixed web farm server names.
Exception is the Azure auto-scaling which is dynamic and you cannot use config keys to set fixed server names - because the scaled out instances are using the same file system files anyway, they are not copied to new instances.

0 votesVote for this answer Mark as a Correct answer

Matthew Butler answered on July 30, 2024 15:22

But the memory clean for example runs the GC so a shared file system won't help there would it?

0 votesVote for this answer Mark as a Correct answer

Matthew Butler answered on July 30, 2024 15:23

Also how does it know whether to run the task on the admin or frontend?

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on July 31, 2024 05:08

The Clean memory task is just for the admin app - it is an old task which has been there since the beginning and it is not anything crucial.

0 votesVote for this answer Mark as a Correct answer

Matthew Butler answered on July 31, 2024 09:51

Thank you, one last question how does it know whether to run the task on the admin or frontend?

Most tasks appear to just run on the admin, do any run on both? if so how does it know to run on both?

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on August 2, 2024 05:27

If the task should be executed on the live site app, it has to be set so. Please, refer to the online documentation on scheduled tasks

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.