Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > Scheduled Tasks in Web Farm View modes: 
User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 9/3/2013 11:19:33 AM
   
Scheduled Tasks in Web Farm
As I read more and more of the documentation I find little pieces I've previously missed. For instance, if I have a web farm with 2 servers in it and I create a scheduled task to run some custom code, I need to create 2 instances of the scheduled task in the Scheduled Tasks module.

Not a big deal, what I'm wondering is do I need to make these modifications (1 task per web farm server) to each of the global tasks?

User avatar
Kentico Customer Success
Kentico Customer Success
kentico_martind2 - 9/5/2013 6:41:40 AM
   
RE:Scheduled Tasks in Web Farm
Hi Brenden,

I'm not sure if I understand your question correctly but as you know, you can specify a server name for the scheduled task, so I would recommend you create a separated task for every web farm server and configure them to run each of them just on the one server.

Regards,
Martin Danko

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 9/5/2013 9:48:21 AM
   
RE:Scheduled Tasks in Web Farm
Martin, yes I see I can specify a server for all tasks. My questioning is, is it beneficial or required to have it run only on one server or should each of the tasks be duplicated and have the different server names in them?

The way I understand you describing it is only one of the two servers would run all the tasks. I see this as a problem, especially if the server running the tasks is unavailable. So if you look at the default global scheduled tasks there is one called Send queued e-mails. Would I need to have this scheduled task in there twice, once for Server1 and another for Server2? If yes, then this should be updated in the web farm documentation to clone all existing scheduled tasks for every server.

User avatar
Kentico Customer Success
Kentico Customer Success
kentico_martind2 - 9/30/2013 12:00:38 PM
   
RE:Scheduled Tasks in Web Farm
Hi Brenden,

If you didn't specify which server should process the task, then first server which will be in touch with this task will handle it, the second server will not process this task anymore. This behaviour is correct.
If you are in the Scheduled task working e.g. with the DB which is shared across all the server, it makes sence to specify a server only in the case that you need to work with some resources that are related to the specific server in the Web Farm (e.g. File System).
... In this case you want all the servers to process this task not only the first one.
However, one scheduled task shouldn't be running on 2 servers at the same time, this should be safe from the Kentico side.

If you need more information or you have any specific question on your mind, do not hesitate to ask.

Best regards,
Martin Danko