WCF call has 15 seconds delay after idle for couple of minutes

 

Customer has a WCF application which uses ASP.Net as a client. The service is hosted on another IIS as well. For secure purpose, customer enabled transport layer security for the WCF service.

 

Customer found the ASP.Net web page took more than 15+ seconds sometimes while normally it takes less than 1 second. With some investigation, we found the slowness happens only when the web application idle for some time and the slowness was due to slow WCF service call. The problem disappears if we disable the transport security.

 

We captured network trace, and found there is about 15 seconds delay for SSL session setup. This sounds the problem was due to build certificate chain.

 

 

Further check, we found customer uses self-signed certificate, and this certificate was not imported into the WCF client(ASP.Net site) trusted root certificate store. The problem was resolved by import this self-signed certificate to the WCF client trusted root certificate store.

 

Certificate Chains

https://msdn.microsoft.com/en-us/library/aa376515(VS.85).aspx

 

 

See you next time.

 

Wei Zhao