views:

14

answers:

2

We have WCF services that operate over multiple protocols for different customers. Most work fine, but when we use SSL the connections take a long time to close. Opening a connection is no problem, but closing is very slow.

The strangest behavior is that the close time is proportional to the amount of data that was transmitted on the connection. If just a few bytes are sent from the server to the client the connection will close almost instantly, but a search that returns several hundred rows takes as long to close the connection as the original search. The close time seems directly proportional to amount of data transmitted. It seems that the results are retransmitted back to the server for verification before the connection will close.

An error is almost never thrown, but the connection close time essentially doubles the required time to execute a call.

Here are the basic settings: Custom binding Binary encoding Reliable session, Ordered=true Binding element is HttpsTransportBindingElement using RemoteCertificateValidationCallback

All of the proxies are constructed programmatically with ChannelFactory.

A: 

Just a theory it could be that it writes to a log when the proxy closes, and you get an extra hit due to decryption, or that it does not cache https results.

  • Do you have any WCF logging turned on?
  • Does the CPU spike when you close the proxy?
  • Could you check if it is actually sending two requests to the server?
Shiraz Bhaiji