Eventually WCF duplex Silverlight 4 client start getting 404 Not Found
errors for poll messages, immediately after poll was send from WCF service to Silverlight
While investigating issue described on this StackOverflow post Static constructor called twice for PerSession WCF service I found that Polling Duplex
start working stable when I switched IIS
configuration for underlying AppPool
to use single worker process rather than 2
as was specified before. I'm not sure why 2
was set before since I do not own this server, but anyway this is what I have now - multiple Silverlight clients launched on the same machine works stable and polls polls polls and no 404
errors, all clients reconnects in 1
attempt after IIS restarts and recycles...
See Performance Application Pool Settings for more details
TL;DR: When IIS hosted WCF resides in AppPool which has more than one worker process - polling duplex becomes unstable. So in case of high load IIS started second process and start creating WCF service instances in second process as well, so I ran into situation when client session was created in one process but it seems poll sometimes reached an other process whcih is not aware of current connection/session so start refusing such messages and entire connection fault.
So Polling Duplex by design is not scalable across multiple processes in scope of a single IIS server and AppPool, in other words if you have more than 1 worker process - this is WebGarden environment and duplex is not scalable across web farms and gardens