Web service slow on first call? In memory or cache option for web service?

R

RJ

I'm fairly new to web services, but I think I understand that they operate
in a stateless manner by design. It seems that there is a delay the first
time you call the web service methods, or call them after some period of
inactivity. I'm guessing there is creation of some proxy which takes time,
and is flushed out of memory if it is inactive for some time. This delay
time makes the overall throughput time unacceptable.

Is there a way to code, tune or configure to avoid this behavior, and get
quick response on all calls? Thanks.

RJ
 
L

Luca Morelli

may be that first time webservice is executed that just in time compiler
start and compile in native code.
 
J

Jack Li

In that case you may want to use ngen.exe to precompile it.

Regards,
Jack Li
MVP (ASP.NET)
 
P

Peter Kelcey

The JIT can occur more than just the first time the webservice is hit
by your client. The JIT compiler only compiles the code into memory and
not to disc. Therefore, all compiled code is lost every time the
worker process is terminated. Your worker process is likely configured
to timeout if it is idle for more than 20 minutes.

Your high overhead after a perioud of inactivity is probably due to the
JIT running AND the worker process itself having to load.

You can avoid this behaviour by modifying your IIS settings to increase
the standard 20 minute timeout.

Peter Kelcey
 
B

Brock Allen

The reason your app is slow upon first request is not because of compilation
but because the appDomain is being loaded.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,240
Members
46,828
Latest member
LauraCastr

Latest Threads

Top