How to maintain Webservices active on window 2003 server

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I wrote web services on .NET 2.0 running on windows 2003 server. When I
start an application using those web services, It's take a long time to
activate them. If I make another call just after It's faster.
But after a long time, when I start the same application again it's take a
long time. I suppose that the web services have been desactivated by the
system. How can I maintain them activated.

Thank's for your help
 
But after a long time, when I start the same application again it's take a
long time. I suppose that the web services have been desactivated by the
system. How can I maintain them activated.

No. They are not deactivated.
Just that entries in cache (compiled assemblies) get invalidated and the
service-code is being recompiled.

I think you are using asmx + asmx.cs/vb combination.

I would suggest you to "publish" your application so that all code is
compiled and put in the bin folder. Note that all .cs/.vb files would be
removed (for codebehind). Any backing .cs/.vb file will tell the runtime to
compile it on the fly.


--
Happy Hacking,
Gaurav Vaish | www.mastergaurav.com
www.edujinionline.com
http://eduzine.edujinionline.com
-----------------------------------------
 
Thanks for Gaurav's input,

Hi PBENISTY,

As Gaurav has said, ASP.NET runtime won't deactive a certain application
and the behavior you met is likely due to the ASP.NET worker process idle
shutdown. Here are some basic background about ASP.NET 2.0 application's
host and compilation features:

**By default, if you do not precompile (or partially precompile --- as
updatable) your ASP.NET(webservice or web page) application, when you first
time request a certain page or webservice endpoint(asmx), the runtime will
perform dynamic compilation. and this is ususally the start-up time you
encounter. After the page or webservice code be dynamically compiled ,
seqential requests won't cause recompile again.


**Event after page or webservice has been dynamically compiled or through
precompilation, there still may occur a delay when we first time request a
page, that is the time the .net execution engin compile .net code into
native code(called jit compilation)

So the above two things make up the totally initial delay when we first
time request page or webservice endpoint in the ASP.NET application.


For the first one(page, asmx's compilation), ASP.NET 2.0 provide precompile
means to let us precompila an website or webservice application. You can
choose to precompile the completely (make the output web application not
updatable) or partially( still can update aspx file after deployment). You
can have a look at the following msdn reference about ASP.NET web site
precompilation:

#ASP.NET Web Site Precompilation Overview
http://msdn2.microsoft.com/en-us/library/399f057w.aspx

also, the VS IDE provide GUI menu for publish a website as precompiled
format:

#Publishing Web Sites
http://msdn2.microsoft.com/en-us/library/377y0s6t.aspx



As for the second one(jit-compilation), this is not affected by
precompilation , and is a common behavior of all .net application. And for
your scenario, if your ASP.NET application's worker process restart, or the
application is restart due to some certain external change(web.config or
"bin" dir be modified ....), all the jit-compiled content will be invalid
and the application will restarted. Next time, when any page , webservcie
endpoint be visited in the application, it will take a period to do the
initial compilation again.

There is one option in ASP.NET process model to configure the idle time of
worker process. This timeout means how long will the ASP.NET worker process
live even there is no request comming to that worker process(its hosted
ASP.NET applications):

#Configuring ASP.NET Applications in Worker Process Isolation Mode (IIS 6.0)
http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/2
6d8cee3-ec31-4148-afab-b6e089a0300b.mspx

You can set it to a large value or event uncheck it so that the worker
process will never be shutdown due to long idle.

Hope this helps. Please feel free to post here if you have anything unclear
or any further questions on this.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================



This posting is provided "AS IS" with no warranties, and confers no rights.
 
Hi,
Thank your help. I've made some configuration on my IIS and it's better. I
've seen on windows Task Manager that the worker (w3wp.exe) has memory
allocated (50MB) when I start my application, and as long as the memory is
allocated the application runs faster. But this memmory is deallocated after
time, and the worker has only 6MB. when I restart my application the memory
is reallocated to the worker, there is why I have to wait 10s.

Is there any solution to maintain memory allocated to the worker?
thanks
 
That's great!

Glad that you've got it working well.

Have a nice day!

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 
Back
Top