I am facing a situation regarding hosting WCF on Session Instancing mode.I am encapsulating the actual situation and proposing an example to replicate it…as below.
The service to be hosted is “MyService”. I am using windows service to host it..with http endpoint.
It will need to support 500 concurrent sessions.(Singleton & Percall cannot be done because the Contract is Workflow based…Login…Function1,Function2,Logout..)
I have 4 Servers each with a hardware capability of supporting 200 concurrent sessions.
So I configured the service on One server as a Router(ServiceHost S = new ServiceHost(RouterService)) with hosting path such as “http://myserver/MyService”. I have set a simple load balancing mechanism and applied the Router table to redirect incoming requests to other three servers where the actual service copies are hosted…(“http://myserver/MyService1″,”http://myserver/MyService2″,”http://myserver/MyService3”)
It is still not working…As soon as hits go above 200…communication error starts…I suppose because when 500 concurrent calls are made, then the Router(capability 200) is also required to stay connected to the Client along with the Actual Service Server…(in Session Call mode)..Is my thinking correct??
My question is…
1) Is my approach correct or flawed from concept…Should I ask the Hardware team to set up NLB…
2) Should we redesign the contract specifically to ensure that the requests can somehow be made PerCall…
3) Someone suggested that such systems should be hosted on cloud (Windows Azure)…will need to look at costs involved…but is it correct…
4) What are the best practicies involved while hosting WCF to handle Session Based Calls.
I understand that my question is complex and there would not be one “Correct” answer…but any help and insight will be really appreciated.
Thanks
“Should I ask the Hardware team to set up NLB…” as per you & “Sticky IP cluster” by Shiraz are the closest one can get to host the given scnerio.
The thing is that WCF sessions are transport based.hence we cannot store these “sessions” on a state server/db like a traditional aspnet.
WCF4.0 has come up with new bindings such as NetTcpContextBinding, BasicHttpContextBinding, WSHttpContextBinding which could help context re-creation on cross machine environment.But I have no production implementation knowledge to provide example.
This article should help you to know more…