logo

Web Agent Timeouts

Just when you think you know everything you need to know about Domino, you learn something new. This week I found out that WebQueryOpen/Save agents have their own timeout settings in the server document.

If you're unlucky enough you might have come across this error:

HTTP Web Server: Lotus Notes Exception - Agent did not complete within the time limit

It might take some fairly poor coding, but it can be done. The code I was dealing with when I saw this was inherited, honest. Although, in this case, it wasn't the code to blame but the way Notes was being forced to act like a relational system.

Either way, if there's absolutely no other way round it, you might need to up the timeout for WQS agents. You do this in the Domino Web Engine tab, which is in the Internet Protocols tab of the server document. In this tab there's a table down at the bottom left corner with a setting called "Web agent timeout":

The fact that this setting is in seconds and not minutes tells you it really ought to be kept as low as possible. After all, for as long as the code is running that's how long the user is left waiting.

The default value is 0, which means the agents can run indefinitely. Probably not a good idea. Also be default, the server only runs one agent at a time. Good idea or not? I don't know.

From the help db:

When the server shuts down an offending agent, resources that the agent was using (such as disk files) may be left open.

It's a bit of a minefield out there. If you find yourself upping the timeout limit above, say, 30s it might well be time for a re-think...

Note: All this applies to agents run from the URL ?OpenAgent command as well.

Comments

  1. Hi Jake,

    well, I think that the most important (and hard to solve) issue here is related to the reason why your agents take that long and even harder, how can you re-think your agent execution.

    In the case of letting Domino behave as a relational database (i.e. some complex queries in a large database), one of t he best solutions is passing the data to an external relational database, for example, i've used mySQL.

    Ok, you can reduce the agent execution time . But, you can face some other annoying problems if something fail. let's say that the agent fail. Normally even taking care of everytihing in the programming side, the agent "hangs" the HTTP threads, and it will be a pain trying to reboot the task again.

    What I do to solve this additional issue is to implement Apache+mySQL+PHP. Since normally all that problems are related to mining Domino to extract information for Reports of complex relations that you can't do in a Domino view, what I do is using the included DECS task, in sync with my application, I pass all the logic to php and I can have the problem solved, so my agents just do simple stuff like wf routing, doc processing, etc.

    It was too long for just a comment, Jake, but it is my approach to solve problems like described by you.

    Just the usual pennies

    .::Alex::.

  2. I'm pretty sure that the default for concurrency is set to disabled in order to preserve backwards compatability for apps built on the earliest Domino releases. Without any available document locking method, some apps could have broken badly if transactions overlapped.

    -rich

  3. Alex makes a good point that developers should really find a way to avoid having a web agent take that long to execute...

    ...it's still good policy to have an agent timeout. No need to bring down the http task if some rogue agent hits an infinite loop. I just enabled this on our intranet server after reading Jake's post. We've never had any problem... but really... what is the downside to turning this on??

  4. re: left open resources

    For some of my bigger reporting agents, I've started putting a simple timer (not a lotus script timer) up front, usually at the end of a loop (convenient). Just check the start time (stored in a variable) against the current time each itteration and look for the time to exceed your own internally defined timeout... then exit gracefully, cleaning up resources as you go automatically. Keeps big reports from hogging the server during busy times when maybe they ought wait till they can complete in a reasonable time.

    • avatar
    • larry
    • Thu 20 Jan 2005 14:16

    Dear Jake,

    I have a database of 100Gb split into 26 databases. A developer I work with, wrote a Java agent to query these 26 databases when doing a full text search. To enable "run webagents concurrently" diminished the search time from over 10 seconds to under 2 seconds!!!!!

    Thank you so much! That's four down on your Amazon wish list!

    • avatar
    • Jake
    • Thu 20 Jan 2005 14:30

    Larry. Many, many thanks. Much appreciated. I couldn't take the suspense, so I peeked at what you'd bought ;-)

    • avatar
    • Matt
    • Thu 20 Jan 2005 17:04

    Recently ran into an issue with this setting on one of our servers (value of 0)...this value was not set and agent that was listed in the WebQuerySave sent email...the unforutnate problem is that the agent was not tested before the promotion, entered a redundant loop, and generated around .5 million emails. Good times.

    • avatar
    • Tamir
    • Thu 3 Feb 2005 00:06

    Hi ,

    Me WQS agent is sending mail but the error I gets is "Notes error: Network operation did not complete in a reasonable amount of time; please retry". this error is accors when the timeout of the agent is reached. which mean if it was 0 then It whould get an unlimitted time... so loop does not solved it. ...

    Tamir

    • avatar
    • Jerry
    • Wed 20 Dec 2006 10:07 AM

    Anyone see how to set the "Run web agents concurrently" when using Internet Site Documents?

    Thanks!

    • avatar
    • Rony
    • Sat 5 Mar 2011 06:00 PM

Your Comments

Name:
E-mail:
(optional)
Website:
(optional)
Comment:


About This Page

Written by Jake Howlett on Thu 20 Jan 2005

Share This Page

# ( ) '

Comments

The most recent comments added:

  • avatar Rony about 14 years ago
  • avatar Jerry about 18 years ago
  • avatar Tamir about 20 years ago
  • avatar Matt about 20 years ago
  • avatar Jake about 20 years ago
  • avatar larry about 20 years ago

Skip to the comments or add your own.

You can subscribe to an individual RSS feed of comments on this entry.

Let's Get Social


About This Website

CodeStore is all about web development. Concentrating on Lotus Domino, ASP.NET, Flex, SharePoint and all things internet.

Your host is Jake Howlett who runs his own web development company called Rockall Design and is always on the lookout for new and interesting work to do.

You can find me on Twitter and on Linked In.

Read more about this site »

More Content