Web Services client software has substantial delay on startup

Discussion in 'ASP .Net Web Services' started by David J. Berman, Aug 2, 2007.

  1. Hello, I'm using Visual Studio .NET 2005 with .NET framework v2.0, Windows
    2003 Server.

    As a consultant I am developing client software on the above platform for
    several different clients. All software that I'm creating that makes any web
    services calls whatsoever have a substantial client-side delay when the first
    web service call is made. There must be some sort of start-up overhead
    associated with the code.

    I'm creating my proxy classes by using the add web reference feature in
    Visual Studio.

    If I make a simple client software that does something like a Login (Enter
    username and password, request an authentication code, and then do some sort
    of request...) the first call takes a very long time, consistantly about 15
    seconds, and after that things are very fast.

    I develop using several computers for many clients at many locations but
    always I have this same behavior with all client software I'm writing using
    these tools.

    Can anyone shed some light on this? Is there a way to reduce the startup
    time associated with my first webservices call? Thank you.

    David


    --
    DavidJBerman.com
    <a href="http://www.davidjberman.com" target="_blank" title="David
    Berman">Visit David Berman</a>
    David J. Berman, Aug 2, 2007
    #1
    1. Advertising

  2. --
    John Saunders [MVP]

    "David J. Berman" <> wrote in message
    news:...
    > Hello, I'm using Visual Studio .NET 2005 with .NET framework v2.0, Windows
    > 2003 Server.
    >
    > As a consultant I am developing client software on the above platform for
    > several different clients. All software that I'm creating that makes any
    > web
    > services calls whatsoever have a substantial client-side delay when the
    > first
    > web service call is made. There must be some sort of start-up overhead
    > associated with the code.
    >
    > I'm creating my proxy classes by using the add web reference feature in
    > Visual Studio.
    >
    > If I make a simple client software that does something like a Login (Enter
    > username and password, request an authentication code, and then do some
    > sort
    > of request...) the first call takes a very long time, consistantly about
    > 15
    > seconds, and after that things are very fast.
    >
    > I develop using several computers for many clients at many locations but
    > always I have this same behavior with all client software I'm writing
    > using
    > these tools.
    >
    > Can anyone shed some light on this? Is there a way to reduce the startup
    > time associated with my first webservices call? Thank you.
    >
    > David
    >
    >
    > --
    > DavidJBerman.com
    > <a href="http://www.davidjberman.com" target="_blank" title="David
    > Berman">Visit David Berman</a>
    John Saunders [MVP], Aug 2, 2007
    #2
    1. Advertising

  3. "David J. Berman" <> wrote in message
    news:...
    > Hello, I'm using Visual Studio .NET 2005 with .NET framework v2.0, Windows
    > 2003 Server.
    >
    > As a consultant I am developing client software on the above platform for
    > several different clients. All software that I'm creating that makes any
    > web
    > services calls whatsoever have a substantial client-side delay when the
    > first
    > web service call is made. There must be some sort of start-up overhead
    > associated with the code.
    >
    > I'm creating my proxy classes by using the add web reference feature in
    > Visual Studio.
    >
    > If I make a simple client software that does something like a Login (Enter
    > username and password, request an authentication code, and then do some
    > sort
    > of request...) the first call takes a very long time, consistantly about
    > 15
    > seconds, and after that things are very fast.
    >
    > I develop using several computers for many clients at many locations but
    > always I have this same behavior with all client software I'm writing
    > using
    > these tools.
    >
    > Can anyone shed some light on this? Is there a way to reduce the startup
    > time associated with my first webservices call? Thank you.


    The start-up delay is associated with the startup of the AppDomain the
    service is located in, JIT compilation, etc.

    The only way to avoid it would be to issue a call to the web service when
    the system starts, and whenever the AppDomain unloads due to the idle timer
    on the application pool it's running in.
    --
    John Saunders [MVP]
    John Saunders [MVP], Aug 2, 2007
    #3
  4. Thank you for your response. However, this doesn't seem to answer my
    question. The delay isn't happening on the server side, it's happening on
    the client side.

    I can demonstrate as follows:
    Set up debug session of client software. Setup simultainious debug session
    of web service by using a second computer.
    A) Start client. Client issues first call to web service, experiences 15
    second delay before breakpoint is hit on the server.
    B) Issue second request on client side. Breakpoint is hit on server
    instantly.
    C) Shut down client.
    D) Restart client, client issues first call to the same web service. Again,
    15 second delay transpires before the breakpoint is hit on web service.

    Second test:
    A) On computer A, connect client to web service. Client issues first
    request, experiences 15 second delay.
    B) On Compuber B, connect same client to web service. Client issues the
    same first request as step A, also experiences 15 second delay.

    This happens every single time I create an application that consumes any web
    service, and it happens on the client side. After the first request completes
    everything is very fast.

    Is there anything I can do to eliminate this startup delay?

    Thank you.

    David




    --
    DavidJBerman.com
    <a href="http://www.davidjberman.com" target="_blank" title="David
    Berman">Visit David Berman</a>


    "John Saunders [MVP]" wrote:

    > "David J. Berman" <> wrote in message
    > news:...
    > > Hello, I'm using Visual Studio .NET 2005 with .NET framework v2.0, Windows
    > > 2003 Server.
    > >
    > > As a consultant I am developing client software on the above platform for
    > > several different clients. All software that I'm creating that makes any
    > > web
    > > services calls whatsoever have a substantial client-side delay when the
    > > first
    > > web service call is made. There must be some sort of start-up overhead
    > > associated with the code.
    > >
    > > I'm creating my proxy classes by using the add web reference feature in
    > > Visual Studio.
    > >
    > > If I make a simple client software that does something like a Login (Enter
    > > username and password, request an authentication code, and then do some
    > > sort
    > > of request...) the first call takes a very long time, consistantly about
    > > 15
    > > seconds, and after that things are very fast.
    > >
    > > I develop using several computers for many clients at many locations but
    > > always I have this same behavior with all client software I'm writing
    > > using
    > > these tools.
    > >
    > > Can anyone shed some light on this? Is there a way to reduce the startup
    > > time associated with my first webservices call? Thank you.

    >
    > The start-up delay is associated with the startup of the AppDomain the
    > service is located in, JIT compilation, etc.
    >
    > The only way to avoid it would be to issue a call to the web service when
    > the system starts, and whenever the AppDomain unloads due to the idle timer
    > on the application pool it's running in.
    > --
    > John Saunders [MVP]
    >
    >
    David J. Berman, Aug 2, 2007
    #4
  5. "David J. Berman" <> wrote in message
    news:...
    > Thank you for your response. However, this doesn't seem to answer my
    > question. The delay isn't happening on the server side, it's happening on
    > the client side.
    >
    > I can demonstrate as follows:
    > Set up debug session of client software. Setup simultainious debug
    > session
    > of web service by using a second computer.
    > A) Start client. Client issues first call to web service, experiences 15
    > second delay before breakpoint is hit on the server.
    > B) Issue second request on client side. Breakpoint is hit on server
    > instantly.
    > C) Shut down client.
    > D) Restart client, client issues first call to the same web service.
    > Again,
    > 15 second delay transpires before the breakpoint is hit on web service.
    >
    > Second test:
    > A) On computer A, connect client to web service. Client issues first
    > request, experiences 15 second delay.
    > B) On Compuber B, connect same client to web service. Client issues the
    > same first request as step A, also experiences 15 second delay.
    >
    > This happens every single time I create an application that consumes any
    > web
    > service, and it happens on the client side. After the first request
    > completes
    > everything is very fast.
    >
    > Is there anything I can do to eliminate this startup delay?


    That's really _not_ the problem I was talking about!

    Can you reproduce this delay with a "hello, world" service? I suspect you'll
    find that it's something specific to your service. It's not the usual
    behavior.
    --
    John Saunders [MVP]
    John Saunders [MVP], Aug 2, 2007
    #5
  6. David J. Berman

    Egghead Guest

    Hmm, it seems that it is the security setting on the networking or PC in the
    client-side (may be in the server-side).
    You must have few PCs sitting at your own office, make a hello web service
    on one of them, and you can find out you do not have that dely at all.

    --
    cheers,
    RL
    "David J. Berman" <> wrote in message
    news:...
    > Thank you for your response. However, this doesn't seem to answer my
    > question. The delay isn't happening on the server side, it's happening on
    > the client side.
    >
    > I can demonstrate as follows:
    > Set up debug session of client software. Setup simultainious debug
    > session
    > of web service by using a second computer.
    > A) Start client. Client issues first call to web service, experiences 15
    > second delay before breakpoint is hit on the server.
    > B) Issue second request on client side. Breakpoint is hit on server
    > instantly.
    > C) Shut down client.
    > D) Restart client, client issues first call to the same web service.
    > Again,
    > 15 second delay transpires before the breakpoint is hit on web service.
    >
    > Second test:
    > A) On computer A, connect client to web service. Client issues first
    > request, experiences 15 second delay.
    > B) On Compuber B, connect same client to web service. Client issues the
    > same first request as step A, also experiences 15 second delay.
    >
    > This happens every single time I create an application that consumes any
    > web
    > service, and it happens on the client side. After the first request
    > completes
    > everything is very fast.
    >
    > Is there anything I can do to eliminate this startup delay?
    >
    > Thank you.
    >
    > David
    >
    >
    >
    >
    > --
    > DavidJBerman.com
    > <a href="http://www.davidjberman.com" target="_blank" title="David
    > Berman">Visit David Berman</a>
    >
    >
    > "John Saunders [MVP]" wrote:
    >
    >> "David J. Berman" <> wrote in
    >> message
    >> news:...
    >> > Hello, I'm using Visual Studio .NET 2005 with .NET framework v2.0,
    >> > Windows
    >> > 2003 Server.
    >> >
    >> > As a consultant I am developing client software on the above platform
    >> > for
    >> > several different clients. All software that I'm creating that makes
    >> > any
    >> > web
    >> > services calls whatsoever have a substantial client-side delay when the
    >> > first
    >> > web service call is made. There must be some sort of start-up overhead
    >> > associated with the code.
    >> >
    >> > I'm creating my proxy classes by using the add web reference feature in
    >> > Visual Studio.
    >> >
    >> > If I make a simple client software that does something like a Login
    >> > (Enter
    >> > username and password, request an authentication code, and then do some
    >> > sort
    >> > of request...) the first call takes a very long time, consistantly
    >> > about
    >> > 15
    >> > seconds, and after that things are very fast.
    >> >
    >> > I develop using several computers for many clients at many locations
    >> > but
    >> > always I have this same behavior with all client software I'm writing
    >> > using
    >> > these tools.
    >> >
    >> > Can anyone shed some light on this? Is there a way to reduce the
    >> > startup
    >> > time associated with my first webservices call? Thank you.

    >>
    >> The start-up delay is associated with the startup of the AppDomain the
    >> service is located in, JIT compilation, etc.
    >>
    >> The only way to avoid it would be to issue a call to the web service when
    >> the system starts, and whenever the AppDomain unloads due to the idle
    >> timer
    >> on the application pool it's running in.
    >> --
    >> John Saunders [MVP]
    >>
    >>
    Egghead, Aug 10, 2007
    #6
  7. David J. Berman

    Pseudo Guest

    I'm seeing the exact same behaviour.

    A simple "Hello World" web service on my server shows about a 15 second
    delay on the client's first call.

    Any of the services on that server have the delay on the first call and then
    any other call is very quick.

    If I use the web interface directly on the server, there is never any delay.

    One thing to note is that I also have a vpn connection to the site with the
    server. I'm guessing maybe it may be trying to establish some sort of
    Windows authentication and timing out before allowing the first call.

    I'll do as you suggest and try a local "Hello World" application.

    Bryan




    "Egghead" wrote:

    > Hmm, it seems that it is the security setting on the networking or PC in the
    > client-side (may be in the server-side).
    > You must have few PCs sitting at your own office, make a hello web service
    > on one of them, and you can find out you do not have that dely at all.
    >
    > --
    > cheers,
    > RL
    > "David J. Berman" <> wrote in message
    > news:...
    > > Thank you for your response. However, this doesn't seem to answer my
    > > question. The delay isn't happening on the server side, it's happening on
    > > the client side.
    > >
    > > I can demonstrate as follows:
    > > Set up debug session of client software. Setup simultainious debug
    > > session
    > > of web service by using a second computer.
    > > A) Start client. Client issues first call to web service, experiences 15
    > > second delay before breakpoint is hit on the server.
    > > B) Issue second request on client side. Breakpoint is hit on server
    > > instantly.
    > > C) Shut down client.
    > > D) Restart client, client issues first call to the same web service.
    > > Again,
    > > 15 second delay transpires before the breakpoint is hit on web service.
    > >
    > > Second test:
    > > A) On computer A, connect client to web service. Client issues first
    > > request, experiences 15 second delay.
    > > B) On Compuber B, connect same client to web service. Client issues the
    > > same first request as step A, also experiences 15 second delay.
    > >
    > > This happens every single time I create an application that consumes any
    > > web
    > > service, and it happens on the client side. After the first request
    > > completes
    > > everything is very fast.
    > >
    > > Is there anything I can do to eliminate this startup delay?
    > >
    > > Thank you.
    > >
    > > David
    > >
    > >
    > >
    > >
    > > --
    > > DavidJBerman.com
    > > <a href="http://www.davidjberman.com" target="_blank" title="David
    > > Berman">Visit David Berman</a>
    > >
    > >
    > > "John Saunders [MVP]" wrote:
    > >
    > >> "David J. Berman" <> wrote in
    > >> message
    > >> news:...
    > >> > Hello, I'm using Visual Studio .NET 2005 with .NET framework v2.0,
    > >> > Windows
    > >> > 2003 Server.
    > >> >
    > >> > As a consultant I am developing client software on the above platform
    > >> > for
    > >> > several different clients. All software that I'm creating that makes
    > >> > any
    > >> > web
    > >> > services calls whatsoever have a substantial client-side delay when the
    > >> > first
    > >> > web service call is made. There must be some sort of start-up overhead
    > >> > associated with the code.
    > >> >
    > >> > I'm creating my proxy classes by using the add web reference feature in
    > >> > Visual Studio.
    > >> >
    > >> > If I make a simple client software that does something like a Login
    > >> > (Enter
    > >> > username and password, request an authentication code, and then do some
    > >> > sort
    > >> > of request...) the first call takes a very long time, consistantly
    > >> > about
    > >> > 15
    > >> > seconds, and after that things are very fast.
    > >> >
    > >> > I develop using several computers for many clients at many locations
    > >> > but
    > >> > always I have this same behavior with all client software I'm writing
    > >> > using
    > >> > these tools.
    > >> >
    > >> > Can anyone shed some light on this? Is there a way to reduce the
    > >> > startup
    > >> > time associated with my first webservices call? Thank you.
    > >>
    > >> The start-up delay is associated with the startup of the AppDomain the
    > >> service is located in, JIT compilation, etc.
    > >>
    > >> The only way to avoid it would be to issue a call to the web service when
    > >> the system starts, and whenever the AppDomain unloads due to the idle
    > >> timer
    > >> on the application pool it's running in.
    > >> --
    > >> John Saunders [MVP]
    > >>
    > >>

    >
    >
    >
    Pseudo, Aug 11, 2007
    #7
  8. David J. Berman

    Pseudo Guest

    I ran the same service on my development machine and no delay on any of the
    calls.





    "Pseudo" wrote:

    >
    > I'm seeing the exact same behaviour.
    >
    > A simple "Hello World" web service on my server shows about a 15 second
    > delay on the client's first call.
    >
    > Any of the services on that server have the delay on the first call and then
    > any other call is very quick.
    >
    > If I use the web interface directly on the server, there is never any delay.
    >
    > One thing to note is that I also have a vpn connection to the site with the
    > server. I'm guessing maybe it may be trying to establish some sort of
    > Windows authentication and timing out before allowing the first call.
    >
    > I'll do as you suggest and try a local "Hello World" application.
    >
    > Bryan
    >
    >
    >
    >
    > "Egghead" wrote:
    >
    > > Hmm, it seems that it is the security setting on the networking or PC in the
    > > client-side (may be in the server-side).
    > > You must have few PCs sitting at your own office, make a hello web service
    > > on one of them, and you can find out you do not have that dely at all.
    > >
    > > --
    > > cheers,
    > > RL
    > > "David J. Berman" <> wrote in message
    > > news:...
    > > > Thank you for your response. However, this doesn't seem to answer my
    > > > question. The delay isn't happening on the server side, it's happening on
    > > > the client side.
    > > >
    > > > I can demonstrate as follows:
    > > > Set up debug session of client software. Setup simultainious debug
    > > > session
    > > > of web service by using a second computer.
    > > > A) Start client. Client issues first call to web service, experiences 15
    > > > second delay before breakpoint is hit on the server.
    > > > B) Issue second request on client side. Breakpoint is hit on server
    > > > instantly.
    > > > C) Shut down client.
    > > > D) Restart client, client issues first call to the same web service.
    > > > Again,
    > > > 15 second delay transpires before the breakpoint is hit on web service.
    > > >
    > > > Second test:
    > > > A) On computer A, connect client to web service. Client issues first
    > > > request, experiences 15 second delay.
    > > > B) On Compuber B, connect same client to web service. Client issues the
    > > > same first request as step A, also experiences 15 second delay.
    > > >
    > > > This happens every single time I create an application that consumes any
    > > > web
    > > > service, and it happens on the client side. After the first request
    > > > completes
    > > > everything is very fast.
    > > >
    > > > Is there anything I can do to eliminate this startup delay?
    > > >
    > > > Thank you.
    > > >
    > > > David
    > > >
    > > >
    > > >
    > > >
    > > > --
    > > > DavidJBerman.com
    > > > <a href="http://www.davidjberman.com" target="_blank" title="David
    > > > Berman">Visit David Berman</a>
    > > >
    > > >
    > > > "John Saunders [MVP]" wrote:
    > > >
    > > >> "David J. Berman" <> wrote in
    > > >> message
    > > >> news:...
    > > >> > Hello, I'm using Visual Studio .NET 2005 with .NET framework v2.0,
    > > >> > Windows
    > > >> > 2003 Server.
    > > >> >
    > > >> > As a consultant I am developing client software on the above platform
    > > >> > for
    > > >> > several different clients. All software that I'm creating that makes
    > > >> > any
    > > >> > web
    > > >> > services calls whatsoever have a substantial client-side delay when the
    > > >> > first
    > > >> > web service call is made. There must be some sort of start-up overhead
    > > >> > associated with the code.
    > > >> >
    > > >> > I'm creating my proxy classes by using the add web reference feature in
    > > >> > Visual Studio.
    > > >> >
    > > >> > If I make a simple client software that does something like a Login
    > > >> > (Enter
    > > >> > username and password, request an authentication code, and then do some
    > > >> > sort
    > > >> > of request...) the first call takes a very long time, consistantly
    > > >> > about
    > > >> > 15
    > > >> > seconds, and after that things are very fast.
    > > >> >
    > > >> > I develop using several computers for many clients at many locations
    > > >> > but
    > > >> > always I have this same behavior with all client software I'm writing
    > > >> > using
    > > >> > these tools.
    > > >> >
    > > >> > Can anyone shed some light on this? Is there a way to reduce the
    > > >> > startup
    > > >> > time associated with my first webservices call? Thank you.
    > > >>
    > > >> The start-up delay is associated with the startup of the AppDomain the
    > > >> service is located in, JIT compilation, etc.
    > > >>
    > > >> The only way to avoid it would be to issue a call to the web service when
    > > >> the system starts, and whenever the AppDomain unloads due to the idle
    > > >> timer
    > > >> on the application pool it's running in.
    > > >> --
    > > >> John Saunders [MVP]
    > > >>
    > > >>

    > >
    > >
    > >
    Pseudo, Aug 11, 2007
    #8
  9. David J. Berman

    Pseudo Guest

    Woohoo! Problem solved for me.

    http://www.thescripts.com/forum/thread635720.html


    Turned off Auto Detect in i.e.

    Bryan




    "David J. Berman" wrote:

    > Hello, I'm using Visual Studio .NET 2005 with .NET framework v2.0, Windows
    > 2003 Server.
    >
    > As a consultant I am developing client software on the above platform for
    > several different clients. All software that I'm creating that makes any web
    > services calls whatsoever have a substantial client-side delay when the first
    > web service call is made. There must be some sort of start-up overhead
    > associated with the code.
    >
    > I'm creating my proxy classes by using the add web reference feature in
    > Visual Studio.
    >
    > If I make a simple client software that does something like a Login (Enter
    > username and password, request an authentication code, and then do some sort
    > of request...) the first call takes a very long time, consistantly about 15
    > seconds, and after that things are very fast.
    >
    > I develop using several computers for many clients at many locations but
    > always I have this same behavior with all client software I'm writing using
    > these tools.
    >
    > Can anyone shed some light on this? Is there a way to reduce the startup
    > time associated with my first webservices call? Thank you.
    >
    > David
    >
    >
    > --
    > DavidJBerman.com
    > <a href="http://www.davidjberman.com" target="_blank" title="David
    > Berman">Visit David Berman</a>
    Pseudo, Aug 11, 2007
    #9
  10. David J. Berman

    TimG Guest

    A slowdown that I experienced (wasn't 15 seconds but more like 4-5 seconds in
    my case) was the executable searching for a xmlserializers assembly (it also
    raises FileNotFound exceptions within the debugger). Once I changed the
    project's Compile | Advanced Compiler Settings | Generate serialization
    assemblies from Auto to On the delay went away (of course you have to include
    the assembly in your deployment). In my case, I do not know why Auto wasn't
    automatically creating the assembly, just that On did create the assembly.

    See http://msdn2.microsoft.com/EN-US/library/bk3w6240(vs.80).aspx for more
    information.

    --

    Tim


    "David J. Berman" wrote:

    > Hello, I'm using Visual Studio .NET 2005 with .NET framework v2.0, Windows
    > 2003 Server.
    >
    > As a consultant I am developing client software on the above platform for
    > several different clients. All software that I'm creating that makes any web
    > services calls whatsoever have a substantial client-side delay when the first
    > web service call is made. There must be some sort of start-up overhead
    > associated with the code.
    >
    > I'm creating my proxy classes by using the add web reference feature in
    > Visual Studio.
    >
    > If I make a simple client software that does something like a Login (Enter
    > username and password, request an authentication code, and then do some sort
    > of request...) the first call takes a very long time, consistantly about 15
    > seconds, and after that things are very fast.
    >
    > I develop using several computers for many clients at many locations but
    > always I have this same behavior with all client software I'm writing using
    > these tools.
    >
    > Can anyone shed some light on this? Is there a way to reduce the startup
    > time associated with my first webservices call? Thank you.
    >
    > David
    >
    >
    > --
    > DavidJBerman.com
    > <a href="http://www.davidjberman.com" target="_blank" title="David
    > Berman">Visit David Berman</a>
    TimG, Aug 28, 2007
    #10
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tim Ward

    Delay in thread startup?

    Tim Ward, Oct 16, 2003, in forum: Java
    Replies:
    1
    Views:
    1,475
    Tim Ward
    Oct 16, 2003
  2. Replies:
    1
    Views:
    542
    jacob navia
    Jun 19, 2007
  3. Chris Zopers

    Startup delay due to compiling

    Chris Zopers, Jun 23, 2008, in forum: ASP .Net
    Replies:
    4
    Views:
    261
  4. John
    Replies:
    4
    Views:
    403
  5. johannes falcone
    Replies:
    2
    Views:
    61
    Kevin Walzer
    Feb 1, 2014
Loading...

Share This Page