Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / September 2006

Tip: Looking for answers? Try searching our database.

Web Service Slow the first time

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Marlene A. Roman - 22 Sep 2006 12:22 GMT
Hope everybody is doing OK.

I have a webservice which I request via https://. I'm also using WSE to
generate an authenticated token.

I understand that the very first call to the webservice is slow because the
webservice needs to JIT.  But I've noticed that after a period of time, when
the webservice is not being used, the request is slow again (only the first
time) and then subsequent requests are responded faster. It's like it went
to sleep and needs to be awake in order to respond to the request faster.

I've used webservices before and I never experience this behavior.  Any
ideas why this could be happenning???

Maybe related to https:// or WSE???

Thanks in advance for any input.

Marlene
Andrew Brook - 22 Sep 2006 16:26 GMT
Hi Marlene,

I experience this as well, i always assumed it was because when the service
hasn't been used for a while
the application gets stopped and as soon as the next request comes in, the
application needs to be restarted.
The effect can especially be seen if a lot of processing takes place on the
startup of the webservice.
I've never looked into whether this behaviour can be reconfigured e.g.
increase the amount of time the webservice can remain idle without being
stopped etc.

Andrew

> Hope everybody is doing OK.
>
[quoted text clipped - 18 lines]
>
> Marlene
Gaurav Vaish (www.EduJiniOnline.com) - 24 Sep 2006 15:14 GMT
> I experience this as well, i always assumed it was because when the
> service hasn't been used for a while
> the application gets stopped and as soon as the next request comes in, the
> application needs to be restarted.

Please check my response on to your query posted on the other group as well.

For testing purpose and final deployment, please publish the website
(precompile) with dynamic updates "disabled" so that there's no need for any
compilation on the fly at all.

Signature

Happy Hacking,
Gaurav Vaish | http://www.mastergaurav.com
http://www.edujinionline.com
http://articles.edujinionline.com/webservices
-------------------

theobaldt1 - 25 Sep 2006 19:28 GMT
> I understand that the very first call to the webservice is slow because the
> webservice needs to JIT.  But I've noticed that after a period of time, when
> the webservice is not being used, the request is slow again (only the first
> time) and then subsequent requests are responded faster. It's like it went
> to sleep and needs to be awake in order to respond to the request faster.

others wrote:
> I experience this as well, i always assumed it was because when the
> service hasn't been used for a while
> the application gets stopped and as soon as the next request comes in, the
> application needs to be restarted.

> For testing purpose and final deployment, please publish the website
> (precompile) with dynamic updates "disabled" so that there's no need for any
> compilation on the fly at all.

Hello.

I have designed web services too and testing one from multiple sources
at random times can show this slowness as the web service needs to be
restarted.  In addition to deployment settings, other ways exist to
have quick response times.
A Web service is like a web page in that after the webmethod has
finished, the parent thread will remove the web service after web
method call and especially after the timeout period is reached on web
server setting.
The other ways to increase performance and In no particular order,

1). If you want the results from the web method returned quickly on the
next caller (< 10 minutes), add and adjust the "CacheDuration"
attribute to the web method like this
<WebMethod (CacheDuration:=600)>
string[] GetSomeData(int someId)

2). Enable session and increase session time out for the web service.
2.a). Enabling session state for the web service (in web.config) can
help too.  Fastest setting is the default mode of "inproc" with the
tradeoff of fault tolerance as the session is "in process" and local to
the web server running the web service.

3. This next option is more work but it will always keep the web
service running on the web server.  Call it from another application
periodically (ie; service or a local application periodically calling
it.)

Hope this helps too

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.