By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,130 Members | 2,100 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,130 IT Pros & Developers. It's quick & easy.

How to eliminate delay making first call to a webservice?

P: n/a
Every time I make any .NET framework based webservice consumer I have
the same problem: The first call my application makes to consume a
webservice takes about 15 seconds. Subsequent calls are very fast.
What is happening during this initial delay, and is there anything I can
do to fix this so my applications start up quickly?

For example, typically the first call to consuming a webservice is some
sort of 'login / authenticate' function. The user puts in a username
and password and clicks ok. 15 seconds go by, now user is logged in and
gets a screen populated with data. The call for the data is instant,
whereas the call to login is slow. This is the same no matter what
applications I use, all .net framework applications that consume
webservices that I have seen so far have this problem.

Is there a fix / workaround?

Thank you very much!

*** Sent via Developersdex http://www.developersdex.com ***
Apr 30 '07 #1
Share this Question
Share on Google+
6 Replies


P: n/a
On Apr 30, 2:57 pm, DaveOnSEN <anonym...@devdex.comwrote:
Every time I make any .NET framework based webservice consumer I have
the same problem: The first call my application makes to consume a
webservice takes about 15 seconds. Subsequent calls are very fast.
What is happening during this initial delay, and is there anything I can
do to fix this so my applications start up quickly?

For example, typically the first call to consuming a webservice is some
sort of 'login / authenticate' function. The user puts in a username
and password and clicks ok. 15 seconds go by, now user is logged in and
gets a screen populated with data. The call for the data is instant,
whereas the call to login is slow. This is the same no matter what
applications I use, all .net framework applications that consume
webservices that I have seen so far have this problem.

Is there a fix / workaround?
You might want to ask this in an asp.net forum, you may get better
answers. Basically, you're running into how IIS recycles the asp.net
worker process. You may need to adjust this so that process isn't
recycled as often.

Apr 30 '07 #2

P: n/a
Andy,
I think your problem actually stems from the JIT compiling process that
occurs upon the first request to the web service. You could use Ngen to
pre-compile your assembly to native code.

PRB: Delay on First Method Invocation on Web Services
http://support.microsoft.com/kb/323577

--
Page Brooks
www.explosivedog.com
"Andy" <an***@med-associates.comwrote in message
news:11**********************@h2g2000hsg.googlegro ups.com...
On Apr 30, 2:57 pm, DaveOnSEN <anonym...@devdex.comwrote:
>Every time I make any .NET framework based webservice consumer I have
the same problem: The first call my application makes to consume a
webservice takes about 15 seconds. Subsequent calls are very fast.
What is happening during this initial delay, and is there anything I can
do to fix this so my applications start up quickly?

For example, typically the first call to consuming a webservice is some
sort of 'login / authenticate' function. The user puts in a username
and password and clicks ok. 15 seconds go by, now user is logged in and
gets a screen populated with data. The call for the data is instant,
whereas the call to login is slow. This is the same no matter what
applications I use, all .net framework applications that consume
webservices that I have seen so far have this problem.

Is there a fix / workaround?

You might want to ask this in an asp.net forum, you may get better
answers. Basically, you're running into how IIS recycles the asp.net
worker process. You may need to adjust this so that process isn't
recycled as often.

Apr 30 '07 #3

P: n/a
On Apr 30, 3:21 pm, "Page Brooks" <NOSPAMpagebro...@gmail.comwrote:
I think your problem actually stems from the JIT compiling process that
occurs upon the first request to the web service. You could use Ngen to
pre-compile your assembly to native code.

PRB: Delay on First Method Invocation on Web Services http://support.microsoft.com/kb/323577
Well, its not my problem, I just replied. :-)

The OP didn't specify that this only happens when a web service is
changed and the first time used after that, so it sounds like the
worker process is being recycled. Also, ngen won't help. Notice the
Symptoms:

"Although you have used the Native Image Generator (Ngen.exe) to pre-
compile an assembly to native code, you may still see a delay that
lasts a few seconds on the first method invocation on the Web service.
"

Apr 30 '07 #4

P: n/a
Does your web.config specify debug="false"? When an application starts for
the first time, a lot of overhead is involved loading assemblies and
initializing the app into a worker process.
As mentioned, IIS Settings can help; these require some study.
Not to sound like an echo, but this really should be in the ASP.NET group.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"DaveOnSEN" wrote:
Every time I make any .NET framework based webservice consumer I have
the same problem: The first call my application makes to consume a
webservice takes about 15 seconds. Subsequent calls are very fast.
What is happening during this initial delay, and is there anything I can
do to fix this so my applications start up quickly?

For example, typically the first call to consuming a webservice is some
sort of 'login / authenticate' function. The user puts in a username
and password and clicks ok. 15 seconds go by, now user is logged in and
gets a screen populated with data. The call for the data is instant,
whereas the call to login is slow. This is the same no matter what
applications I use, all .net framework applications that consume
webservices that I have seen so far have this problem.

Is there a fix / workaround?

Thank you very much!

*** Sent via Developersdex http://www.developersdex.com ***
Apr 30 '07 #5

P: n/a
After my ASP.NET website sits idle for more than 20 mins the next request is very slow. The reason is that the application domain is flushed from IIS and the application needs to be recompiled. I found this utility to be handy. http://www.spikesolutions.net/ViewSo...2-05f6eded3b82
EggHeadCafe - .NET Developer Portal of Choice
http://www.eggheadcafe.com
Sep 21 '07 #6

P: n/a
HI,

<Jack Joneswrote in message news:20**********************@gmail.com...
After my ASP.NET website sits idle for more than 20 mins the next request
is very slow. The reason is that the application domain is flushed from
IIS and the application needs to be recompiled. I found this utility to be
handy.
http://www.spikesolutions.net/ViewSo...2-05f6eded3b82
I bet this is someting that can be configured in IIS, check the IIS manuals
Sep 21 '07 #7

This discussion thread is closed

Replies have been disabled for this discussion.