Answered by:
Self hosted WCF service

Question
-
We've changed our service to use nettcp bindings. It's a self hosted WCF service.
Everything works fine, however, after running our test for 10 iterations our client (ASPX) can't connect to the service anymore.
I ran netstat and saw that there are 10 established connections to the service. I believe that we are hitting the max connection limit .
Even if I increase this maxconn number, eventually I will hit that limit again.
What do I need to do in order to use nettcp without running out of connections ?
We are using a singleton InstanceContextModel- Edited by PaulJ1 Friday, January 29, 2010 4:17 PM
Thursday, January 28, 2010 11:18 PM
Answers
-
Hi Paul,
As for the concurrent connection limitation, the first thing to check is the WCF service throttling settings that will control the concurrency behavior of WCF service(such as intance number, session number....).
#Throttling in WCF
http://kennyw.com/indigo/150#[WCF]Things that will impact concurrency & capacity behavior of WCF service (with simoultaneous client requests/connections)
http://blogs.msdn.com/stcheng/archive/2009/01/06/wcf-things-that-will-impact-concurrency-capacity-behavior-of-wcf-service-with-simoultaneous-client-requests-connections.aspx
Please remember to mark the replies as answers if they help and unmark them if they provide no help.- Proposed as answer by Steven Cheng - MSFT Thursday, February 4, 2010 2:30 AM
- Marked as answer by Riquel_Dong Thursday, February 4, 2010 9:08 AM
Monday, February 1, 2010 7:40 AM
All replies
-
You have to make sure that you don't open a connection for each iteration.
Once a connection is no longer needed you have to close it in the client by calling Close() on the proxy.Thursday, January 28, 2010 11:28 PM -
We do call close.
PJThursday, January 28, 2010 11:58 PM -
Hi Paul,
As for the concurrent connection limitation, the first thing to check is the WCF service throttling settings that will control the concurrency behavior of WCF service(such as intance number, session number....).
#Throttling in WCF
http://kennyw.com/indigo/150#[WCF]Things that will impact concurrency & capacity behavior of WCF service (with simoultaneous client requests/connections)
http://blogs.msdn.com/stcheng/archive/2009/01/06/wcf-things-that-will-impact-concurrency-capacity-behavior-of-wcf-service-with-simoultaneous-client-requests-connections.aspx
Please remember to mark the replies as answers if they help and unmark them if they provide no help.- Proposed as answer by Steven Cheng - MSFT Thursday, February 4, 2010 2:30 AM
- Marked as answer by Riquel_Dong Thursday, February 4, 2010 9:08 AM
Monday, February 1, 2010 7:40 AM