Java Agents

Hi All,

We are having a problem with our Java agents. We have some rather complicated agents that take several minutes to run. They call external jar files that are located in the jvm\lib\ext directory on the server which contain the bulk of the code. Our problem is that while these agents are running no other agents run, everything just stops until they are finished. We can load pages and framesets that don’t use any agents but anything else just waits until the java agent is done.

We had originally written these agents in lotusscript and did not have any problems with them then but we decided to try java as there were some things we wanted to do that lotusscript couldn’t. I can’t believe that this behaviour is normal but I have looked at our setup and tried all sorts of things with configuration but I must be missing something. The Max concurrent agents is set to 10.

Does anyone have any ideas on what I’m doing wrong?

Thanks

Michael.

Subject: Java Agents

Are you recylcing your objects after they’ve been used? I am wondering if the caveat at the end of

http://www-10.lotus.com/ldd/46dom.nsf/0/4600bba5f42ed834852569290053739e?OpenDocument

by the venerable JK (not Rowling) could be a factor on performance or the lack thereof.

George :slight_smile:

Subject: RE: Java Agents

Gerorge,

We recycle everything as we use it - we’ve been down that path before…

Thanks,

Michael.

Subject: Java Agents

Are the web agents? The the configuration you used will not apply to make them run concurrently.

If they agent manager agents, are they all located in one database? Agent is one database are queued to the same agent manager to minimize contention on the database.

Look for more tips and hints like this in Agent FAQ under resources.

Subject: RE: Java Agents

Julie,

Thanks - I’ve been going though all the FAQs and such but haven’t come across anything yet, that’s why I posted. The agents are web agents - I wasn’t aware that the agent manager setting was not relevant here so thanks for pointing that out. This one agent could be called more than once by different users - can a web agent be called multiple times concurrently? It seems to stop all agent activity though - even the webadmin.nsf won’t load any of the agent based frames.

thanks again

Michael.

Subject: RE: Java Agents

Yes, this is indeed interesting - I never realised either that the agent settings didn’t apply to the web - is there no way to get them running concurrently? I would have though that in this day and age it’s necessary. Does the same thing apply to servlets?

George :slight_smile:

Subject: RE: Java Agents

Yes, you can run web agents concurrently, but since http task runs them not the agent manager the settings are under web server tab.

Agent FAQ article “Troubleshooting agents” goes over the architecture of what agents are run by what task. The article start with this section as it is very important for troubleshooting.

Agent FAQ:

http://www-10.lotus.com/ldd/46dom.nsf/7e6c7e584a76331b85256a46006f083e/574c99ccb345839185256976004e811e?OpenDocument

Troubleshooting agents article:

http://www-10.lotus.com/ldd/today.nsf/62f62847467a8f78052568a80055b380/ef1565a0b202808285256c94004fd0fb?OpenDocument&Highlight=0,kadashevich

Subject: RE: Java Agents

Please forgive me if I’m being dim Julie but I’ve gone through the article in question and indeed find the reference that the HTTP task is in charge of web agents but nothing about concurrent agent configuration in the server document for them - could you give me a more specific pointer?

Thanks, George :slight_smile:

Subject: RE: Java Agents

names.nsf-> Server Document → Internet Protocols → Domino Web Server → Web Agents (bottom of the page).

Subject: RE: Java Agents

Thanks for your patience Julie, I was indeed being dim. I’m going to go on now and do some testing to see how upping the thread count increases performance. You did mention in this forum passim that there was some redbook and/or yellowbook documentation but you weren’t sure where - have you since found it? - Many thanks, George :slight_smile:

Subject: RE: Java Agents

Thanks very much Juile - I’ll look at that now.

George :slight_smile:

Subject: Java Agents

Just out of curiosity, what kind of things could LotusScript not do, that Java could?

Subject: RE: Java Agents

Mainly using Apache project XML tools such as FOP.

Subject: RE: Java Agents

Michael -

Sorry . . . no silver bullet, but a few questions:

Out of curiousity, what OS is the server running? (you’ve indicated “All Platforms”)

How many processors are there on the server in question?

What type of agents are they? (i.e., called from the web vs scheduled)

Ten concurrent agents seems like a lot. What happens if you bump it down a bit?

What might a typical source be for PDF output?

Are you spawning any new Threads? If so, could there be a race condition?

Subject: RE: Java Agents

Dallas,

. OS - Win2000 Server

. Processors - Dual. P3 on one machine, P4 on another.

. The agents are called from the web.

. I’ll try reducing concurrent agents - I just set it to maximum to see if that was what was holding things up.

. The agent queries one or more documents (sometimes hundreds) to create an XML data set which is then pumped into various tools depending on the output required - in the case of PDF we use FOP - other times it is sent to the browser to be transformed with XSLT or transformed on the server to HTML for browsers that don’t do XSL.

. We aren’t spawning any threads that I am aware of but even agents that are unrelated to this won’t run until this has finished so I can’t see that there would be a race condition - unless there is some Domino setting that we’ve tripped in our agent.

Thanks

Michael.

Subject: RE: Java Agents

Hey Michael -Is this poor performane something that has only recently become a problem? Has something changed?

In any case, I believe the “max concurrent agents” setting only applies to those agents that are run by the agent manager task. Since your agents are called from the web, they run via the http task.

I’ve done a fair amount of Notes stuff with Java, but the topic of web agents is admittedly not my forte.

A couple of ideas . . . if I’m way off the mark, I’ll trust that Mika or someone else will (gently) correct me. :slight_smile:

Watch the server tasks when the response time is slow to identify which task(s) are taking the most CPU (I know there are Windoze admin tools to use to do this type of thing, but I’m not that familiar with them). Depending on your findings, you may try tweaking your server settings a bit. Specifically, the two that come to mind are:

Internet Protocols → HTTP → “Number active threads”

Internet Protocols → Domino Web Engine → “Run web agents concurrently?”

Bumping up the active threads allowed may or may not help, but I suspect enabling concurrent agents will probably speed things up a bit if it’s not already enabled. Note that it may impact other agents as well (the topic of multithreading LotusScript agents is covered extensively in Designer help). There’s also more information under the topic Improving Web server performance in the Admin help.

Beyond that, you might consider:

temporarily enabling the “JavaVerbose” setting (i.e., change it to 1) in the server’s notes.ini. This obviously won’t fix anything. In fact, enabling it will slow things down because of the sheer volume of information it logs, but it may give you some indication of underlying problems if they exist. Just don’t leave it enabled for long.

hardware upgrades (i.e., more/faster processors, memory, etc) although I don’t really think that’s the problem.

if possible, replacing some of the agents in question with an equivalent servlet to avoid the overhead of invoking an agent (may or may not be a realistic option for you).

hth,

dgg

Subject: RE: Java Agents

Dallas,

Thanks for your help - I’ll give these things a go. I was unaware of the Web Agents vs Agent Manager settings.

The problem seems to only occur with Java agents - lotusscript agents called the same way and doing almost identical tasks doesn’t lock out other agents. We’re going through the java code but there’s nothing obvious there that would lock things up and I would imagine that even if there was a lot going on with the java agent, other things could still run.

Thanks again for your help.

Michael.