Webservice initialisation issue
I have a simple web service. When开发者_JAVA百科 I call my test method for the first time it takes about 5 seconds to respond and thereafter it takes very less time which is fine.
But if my application stays idel for 5 mins and when i call the same method again it takes same amount of time took before to respond. How can I make it faster ?
I tried by setting the keepalive = true and pre compiling and deploying, still no luck
localhost.WebService1 svc = new WebSvcTest.localhost.WebService1();
private void button1_Click(object sender, EventArgs e) {
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
string returnVal = svc.HelloWorld();
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
// Format and display the TimeSpan value.
string elapsedTime = String.Format("{0:00}:{1:00}:{2:00}.{3:00}",
ts.Hours, ts.Minutes, ts.Seconds,
ts.Milliseconds / 10);
MessageBox.Show(elapsedTime);
}
problem was IIS ProcessModel IdleTimeout was set to 20 mins. I set it to 0, now everything works fine. thanks a lot
精彩评论