We do pretty much what you said, except with a little tweak.
If multiple requests come in for the same session, all but the first request wait (literally: Object.wait()) until the first one has finished.
We also keep a track of which was the last thread to come in the door.
When the request being processed finishes, only the thread that was the last in the door gets processed.
All other requests just get ended with no content (and hence minimal processor usage), because there's no browser waiting for the response anyway.
Of course, this won't work if you want to support multiple browser windows attaching to one session.
Graham.
Thomas Lange wrote:
Hi,
some of my JSP pages take a few seconds to process.
When users get impatient and request them again, without having waited for the initial request to complete,
load builds up rapidly, making everything even slower and taking down tomcat completely quite soon.
Any ideas on how to prevent this?
I already thought of setting an attribut in the session at the beginning of processing a page and removing it again at the end. Following concurrent requests by the same user (session) will first check if the attribute is present and just return a blank page, if it is. But what to do, if an user cancels the request, and the page isn't processed until the end, as it fails with an IOError? Isn't there any better way?
I'm using Apache 1.3.29 + Tomat 5.0.19 + mod_jk2 2.04
Thank you! Thomas
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- Graham Lea Software Engineer Forge Research Pty Ltd Suite G11, Bay 9, Locomotive Workshop Australian Technology Park, Cornwallis Street Eveleigh NSW 1430 Australia Phone: +61 2 9209 4152 Fax: +61 2 9209 4172 www.forge.com.au ---------------------------------------------------------------------- This message contains privileged and confidential information intended only for the use of the addressee named above. If you are not the intended recipient of this message you must not disseminate, copy or take any action in reliance on it. If you have received this message in error please notify the sender immediately. Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of another (including a Body Corporate). ----------------------------------------------------------------------
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
