Why won't scheduled Notes Agent run

1.8k views Asked by At

I have developed a Notes agent that cross matches documents in the database based on certain criteria. We have a development server, a train server and a live server and each is running an instance of the relevant application. The agent does exactly what we require on all three instances when we run the agent manually. The agent also runs fine when scheduled for a specific time on the development and train servers. However, when we schedule the agent on the Live server it does not run and the logs only state the following;

"Agent Manager: Execution time limit exceeded by Agent 'MatchingAlert|MatchingAlert' in database 'PBT\PBTLive.nsf'. Agent signer 'Application Development/IT/***************'"

All three servers appear to be set up exactly the same. Also, I have transfrred the documents from the Live to the Development instance and it still runs as scheduled on the Development instance so it can't be the fact that it is dealing with more documents in the Live instance. So what will be causing this?

Edit: Something just occurred worth mentioning. We wanted the Train instance to have exactly the same documents as the Live instance so I actually deleted the Train instance and made a new copy of it using the Live instance as a template and now the scheduled agent is not running and showing the same output to the logs as the Live instance so it must be to do with the Live instance and not the Live server but what would it be?

2

There are 2 answers

7
Knut Herrmann On BEST ANSWER

According to log entry, the agent runs but needs to long to accomplish the task.

Maybe

  • "Max. LotusScript/Java execution time" in Server document is too short or
  • you don't have enough rights as 'Application Development/IT/***************'" signer on production server and the agent wastes time to try to access something again and again.

Make sure that agent's signer has all rights necessary to execute the agent.

7
Tode On

The log entry quite clearly states what is wrong: The agents runs longer than it is allowed to run. Best practice is to add some logging to your agent.

First of all I would check, how long the agent runs in your test- environment (right- click on the agent after a successfull run and check the log).

If that time is just fast enough to complete within timelimit (e.g. 12 Minutes run and server is configured to allow maximum of 15 Minutes), then it might be enough to run the agent on a server with heavier load to exceed the time limit.

In addition: Usually there are two different settings for the maximum agent runtime, "Daytime Parameters" and "Nighttime Parameters". If one agent runs during nighttime, it has usually a lot more allowed runtime than during daytime.

Depending on the code you use, there can be several reasons why an agent runs much longer on one instance of a database as on an other (even on the same server).

e.g:

  • If you run through a view the view might not be up to date and has to be built first. This can take a huge amount of time on a heavily used server
  • connecting to another database might once be considered a "local" call and on another server it is a "remote"- call. Again this can have huge impact
  • because of different addressbooks in one case the signer of the agent might see only few documents, in the other case sees all of them
  • using any FTSearch- Method without an existing fulltext ...
  • Using NotesDocumentCollection.getNthDocument() can result in HUGE performance- issues ...

This all is guessing without knowing your code. And the reason for your problem most probably depends on your code.

So again the advice: Build in some "logging" in your code: Let it "tell" you, where it is, and what it has done already. Let it output runtimes... Then you will see, where your productive environment loses the time.