Link to home
Start Free TrialLog in
Avatar of avner
avner

asked on

Browser Timeout

Any idea how to configure HTTP call timeout ?
Also any information will be helpful (for example who defines the timeout , Browser or Web-Server ) ?

Any help would be greatly appreciated.


-Avner
Avatar of NetGroove
NetGroove

Not absolutely sure, but from my experience is the timeout value set on server. You can set it to several hundred minutes, longer then one hour, and the time out is triggered by server.

Most web server do have several timeout values for different procession environments.

The browser timeouts are from failing connection establishing. But after the browser request is correctly posted to web server is the timeout control on server side.

Avatar of avner

ASKER

Thanks, Any idea how to control this timeout on Tomcat or sunONE ?
Look in httpd.conf for lines looking like this:

<Context path="" docBase="/home/webhome/myfoo/"
defaultSessionTimeout="60" />

And for SunONE:

How do I set the maximum number of sessions allowed on iPlanet Web Server?

   1. Modify either the context.properties or servlets.properties file.

      In the context.properties file, add the following line:

      context.global.sessionmgr.initArgs=maxSessions=2000,timeOut=300,reapInterval=150

      In the servlets.properties file, add the following line:

      servlets.sessionmgr.initArgs=maxSessions=2000,time Out=300,reapInterval=150
   2. To invoke the new value, restart the server.

Copied form here:
http://developers.sun.com/sw/docs/faqs/appserver/iws_faq.html

ASKER CERTIFIED SOLUTION
Avatar of NetGroove
NetGroove

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of avner

ASKER

NetGroove, these are both "sesssion timeouts".

When browser is connecting to the web-server a "sesison" is created, timeout is the time the session was inactive.

I'm looking for a specific HTTP call timeout.

I just recived the following note :
In Internet Explorer 4.01 Service Pack 1 or later (IE 5, 5.5, 6), you can
change the timeout by adding a ReceiveTimeout DWORD value in registry key:
HKEY_CURRENT_USER\ Software\ Microsoft\ Windows\ CurrentVersion\ Internet
Settings with a data value of (number of seconds)*1000. To set a 2 minute
timeout duration, set the ReceiveTimeout data value to (2*60*1000) = 120000.
Restart your computer.


And I'm going to check it out.
Sorry, the Tomcat timout value was set in server.xml, not in httpd.conf

Ok, that parameter is a very good point.

But late me state my definitive note: in HTTP there is no such thing like a session. Full stop.
Every browser request is a single request with its own response. After the response there is no session.

Of course do the server track a user by ip and establish a session for that node, but http is not a session bound protocol.
Therefore also do not exist such things like session timeouts after idle time. Only timeout after no response.

This does not confuse with user logon session established by cookies or by URL parameter sessions or by hidden form fields sessions. They are observed by server and discarded after some configured idle time after last served request. But again, this is not a http request timeout, it is a virtual session timeout.





Avatar of avner

ASKER

Read the following thread, also search for "timeout HTTP session" :

http://www.mail-archive.com/orion-interest@orionserver.com/msg14196.html


There is defiently something that is called a "Session" under HTTP and is supported by all  web-serves and all browsers, If I'm not wrong it is automatically handled using cookies.
No, it is not handled automatically, it is handled solely by web server.

Basic problem is that there is no session for http. Therefore it is an absolutely problem to logoff from a realm when you told your userid and password to your browser. The browser cached your userid and password for particular realm and send it to that realm even day after you entered in browser if you did not stop the browser in meantime. It was even worse: there was no regular method to logout from that real except a complete browser stop or receiving a tricky response 401 for that realm to force a new logon.
To solve that dilemma with the basic http authentication most web server offer their method of http logon and name it session. That session are user logon tables managed by web server and sending cookies to client browser to keep reference to corresponding user name table entry on web server. The garbage collection is managed by web server logout commands or session timeouts.

But again, this logon methods are under the control of the web server (of course is the browser able to destroy the session cookie) but there is no such thing like http session standard RFC how to handle browser sessions. Every http sever implements its own session behavior.

Avatar of avner

ASKER

Ok, I understand your point, since HTTP sessions are so common and well supported, I thought it was some sort of HTTP standard.

To my specific issue, the Registry key I listed above did solve my problem, but I'm looking for a way to do that fro the web-server's end.

Any ideas about this one ?
The simplest one is that your web server sends every sixty seconds one single blank to the browser and so keeps the session (the request :) alive until full response can be sent to browser.

Avatar of avner

ASKER

Yeah, the problem is that I want it the other way around.

I want to make the timeout shorter then it currently.

We are working with something like that :

Browser >>> Web-server (Servlets) >>>> DCOM (Com+/ MTS) >>> C++ BG objects.


And sometimes the call between the Web-Server and the DCOM just hangs, we are unable to understand why and when.

And so, for a temporary workaround we want to limit the timeout to 40 seconds and then the client will not have to wait for so long even if something had stopped responding.
You can of course start a timer interval which will invoke some action if the response from web server does not rewrite the submiting request page.
Is this idea something for you? You know, I am talking about this:

  document.myForm.submit();
  window.setTimeout("killRequest()", 40000);

You see?

Avatar of avner

ASKER

When the HTTP call is hanging no JavaScript can be executed, the explorer is at "halt" mode and everything seems to be stuck, the only way to continue is killing the process through Task Manager.



That is strange.

Is your request a simple form.submit() or something else?
Avatar of avner

ASKER

No, it's an XMLHTTP request using the MSXML object.

Do you think that in case of form.submit() it will not hang ? if so than whay would killRequest() do ?
Uhps!

Show me the complete example or send it to netgroovy@yahoo.com

First question is whether you call the send() method in asynchronous mode or not. I suppose you have set it to true, so it is synchronous and hanging.

Send me your html page for analysis, or paste it here.



Avatar of avner

ASKER

Unfurtunatly it is not that simple the method I'm using is something like that :


Unfortunately it is not that simple the method I'm using is something like that :

function XmlHttpRes (sUri,Synchronic, Param , postMethod, bAddRequestHeader)
            {

                  var bSynchronic  = (Synchronic==null || typeof (Synchronic)=="undefined") ?false : Synchronic ; // defaulted to async sent;
                  var sPostMethod = (typeof postMethod=="undefined")? "GET" : postMethod ; //Method of post is defaulted to GET
                  var sParam =  (Param==null || typeof (Param)=="undefined") ? null : Param ; //Set the Sent Data Param
                              
                        this.oXML= new ActiveXObject("MSXML2.XMLHTTP");      
                        this.oXML.Open(sPostMethod, sUri, bSynchronic);
                        if (bAddRequestHeader)
                              {
                                    this.oXML.setRequestHeader ("Content-Type", "application/x-www-form-urlencoded");
                              }
                        this.oXML.Send(sParam);
      }



As you can see I use different params to use different types of call (some times it's synchronic and some times it's not) and therefore I can't really give you a specific example.

The hang itself occures on different times and we suspect the problem is on the LoadBalancer,  but what we want for now is something very "simple" :  if freezing occurs, make users wait as less as possible.

Thanks for the help so far.