Tuesday, March 29, 2011

Opalis - Concurrent runs of a policy

If you have a policy that runs on a schedule Opalis kicks off that policy even if the previous run hasn't finished yet.  We us Opalis to move data between databases, normally everything runs find except for around month end when the transaction volumes are heavy.  During these times we found that Opalis was policies multiple times concurrently which caused a heavy load on our database servers.

I haven't found any setting inside Opalis that says if a policy is already running when the next scheduled time is upon us, don't start it.

To get around this we setup a "control" table in the database with a datetime stamp of when we started the policy and as the last step in the policy we update it again.  We then add a database query to the policy as the first step and query the control table at the start of the policy, if that timestamp has not updated within the time limit that the policy is scheduled for we stop processing and exit.  By the next scheduled run, the first run has usually finsihed and updated the timestamp so the next run starts as usual.

No comments:

Post a Comment