Recycle App Servers

Jchapple
New Contributor

Curious if anybody knows how to accomplish something I am trying to do.  We have a few DM jobs that are pretty intensive that we run over night and once that job runs it seems like the server it ran on gets bogged down and eventually that server turns red, stops responding and jobs get hung up.  What I would like to do is add another step that says once my big DM is done restart that server but I don't want to force restart it in case a user is currently running on that same server.  So I want to do something similar to what happens in these "recycling" options so that once it gets to the recycle server step in the DM job it stops accepting new jobs and waits until all current jobs are done running then restarts that server.  Curious if anybody knows how to accomplish this or something similar that would fix my issue.

Jchapple_0-1678313717270.png

 

1 REPLY 1

JackLacava
Community Manager
Community Manager

There is a very old Solution on Marketplace, called Process Blocker. I'd suggest you to download it and examine the code, to get an idea of a possible approach. Basically, the way it works is by adding a check in the event handlers for Data Management (for DM jobs) and Data Quality (for Process workflow steps), looking at options set in a custom table. So, in your case, you could have a situation where:

  1. your Big Job flips a switch in a custom table or file once it's done crunching numbers
  2. in event handlers, your code checks for that switch, basically blocking any new job from running
  3. some sort of monitoring code (e.g. a System Extender rule checking the properties of args.ServerSetArgs, which contain metrics) waits for jobs to be zero, kicks the server, and flip the switch back. This would probably be better done externally, to be honest, via Powershell or similar.

This is all theoretical, I've never done it, but it seems reasonable.

If your environment is in our Cloud, I'd strongly suggest to speak to Support - chances are they can do most of this for you. If not, it might still be beneficial to ask them before you start cracking on code, in case they can recommend a better approach.