Re: Long-running ASP page using ServerXMLHTTP...

From: J. Baute (WUPYRDEDAWJD_at_spammotel.com)
Date: 03/08/04


Date: Mon, 8 Mar 2004 17:22:46 +0100


Are you sure that ALL page requests are being blocked when this page is
running?

If you are using Sessions it's normal that all requests for a single session
are serialised. So if you test from your own machine with 2 browser windows
sharing the same session it's normal you won't see anything happening in the
second window as long as the first window hasn't loaded.

It's not normal however that your complete site would be put on hold simply
because someone is requesting a slow page, unless there is something else
which causes your application to run in a single thread (like COM objects in
application object or something).

However, whatever the problem is, I would try caching that external page
anyway, either to memory or to your webservers disk.
Instead of putting the user on hold for 30 seconds you could read the XML
data from the cached file, which will be a lot faster, and update it after a
certain interval (eg. 15 or 30 min). It depends on how fast the data
changes of course, but even if it would be only as short as 1 minute, you
would still be able to get some better performance.

Updating the cache itself can be done from your ASP page itself, pretty much
how you do it now, or from a seperate piece of software (a VB exe, or
simpler, a small VBScript script running in the NT scheduler).
The seperate exe/script would IMO be the best choice, because your webuser
will in that situation never have to wait the 30 seconds it takes to fetch
the page from the slow, external site, which will make the actual page seem
blindingly fast.

hope this helps,
J.

"Barry Lloyd" <none> wrote in message
news:#5nkB5QBEHA.640@TK2MSFTNGP09.phx.gbl...
> Hi all,
> Ok, Im sure this has been covered a million times before but Ive tried
> searching and cant find anything that deals with the exact problem Im
> having.
> I have an ASP page that uses the MSXML2.ServerXMLHTTP object to retreive
> data from a 3rd party. The codein my page is as follows...
>
> ****ASP (VBScript) CODE****
> Set obj=Server.CreateObject("MSXML2.ServerXMLHTTP")
>
> sURL='http://www.somewhere.com/test.asp'
>
> With obj
> .Open "GET", sURL, True
> .Send
>
> Do Until .readyState=4
> .waitForResponse 1000
> Loop
>
> sRetVal=.responseXML.xml
> End With
> ***************************
>
> Ok, this works fine (obviously the URL is different), but takes up to 30
> seconds to execute due to slow response from the 3rd party which we have
no
> control over. The time delay in itself is not an issue...however while
this
> script is running any other requests for ASP pages are 'queued' behind it.
> So no other ASP pages execute until after this script has finished (up to
30
> seconds)
>
> Can anyone explain a way around this. Do I need to write a VB app (for
> example) to do this, allowing me to use something like DoEvents??? (I dont
> see how this will work as the ASP page will still be waiting for the
> response from the VB app rather than from the ServerXMLHTTP object) Or is
> there some way of running this page asynchronously so that other ASP pages
> are allowed to execute while we are waiting for the response from the 3rd
> party?
>
> Note: I cannot schedule this to run at a less busy time (for example), it
> has to be live as this is a quoting system and the client is waiting.
>
> Any help is much appreciated.
>
> Thanks
> Barry Lloyd
>
>



Relevant Pages

  • Re: what is global.asa
    ... ASP is actually an ISAPI (Internet Server ... and handles requests for ASP pages. ... specific Collection for each User Session. ...
    (microsoft.public.frontpage.programming)
  • Re: Confused about ASP, "sessions", and queuing of multiple requests
    ... this "ASP queues requests" is normal behavior with IIS and ASP. ... I'm thinking that the one system that we think is not queuing requests ... > inside or outside the session) are to be accessed by both requests. ...
    (microsoft.public.inetserver.asp.general)
  • Re: Confused about ASP, "sessions", and queuing of multiple requests
    ... this "ASP queues requests" is normal behavior with IIS and ASP. ... I'm thinking that the one system that we think is not queuing requests ... > inside or outside the session) are to be accessed by both requests. ...
    (microsoft.public.inetserver.iis)
  • Confused about ASP, "sessions", and queuing of multiple requests
    ... that indicate that ASP will queue up requests when they come in with the ... My second is regarding what "same session" means in this context? ... Several of the posts that I've seen with respect to this queuing just say ...
    (microsoft.public.inetserver.asp.general)
  • Confused about ASP, "sessions", and queuing of multiple requests
    ... that indicate that ASP will queue up requests when they come in with the ... My second is regarding what "same session" means in this context? ... Several of the posts that I've seen with respect to this queuing just say ...
    (microsoft.public.inetserver.iis)