iis - multiple users accessing wcf, stalls service -
we have setup:
1) web site fronts functionality user, 1 of modules connect separate web service (wcf) reference.
2) internal web service visible within network provides separate functionality public website. render , return data , rdlc reports byte array.
when tried running web service's application pool under network system, website failed access it. when set web service local system works.
the issue left whenever more users try access web service website, somehow, web service stalls , pool refresh required make running again. i've checked settings of iis web service , connections set unlimited.
help!
as said in comment, serious work typically recommend against using iis application host. has several drawbacks (it dictates service address, has deal app pools , recycling etc.)
instead, production services in self-hosting manner, e.g. inside windows nt service. gives me lot more flexibility: i'm in full control of aspects, including addresses, , can start/stop services @ will, , i'm not @ mercy of app pools being recycled.
basically, need create instance of servicehost
wcf runtime, , give service class host, , optionally 1 (or multiple) base addresses service exposing endpoints at.
servicehost svchost = new servicehost(typeof(mywcfservice)); // optionally set additional properties here, if needed svchost.open(); // now, host open , accepting
when want stop listening requests, call svchost.close()
, service host gone.
when package nt service, typically setup , .open()
of service host in onstart
method, , handle svchost.close()
in onstop
method of nt service.
this app contains servicehost
doesn't have nt service - testing, it's easy put servicehost console app, start , bring wcf service life, test/debug/enhance, , close console app again. easier mucking around iis, virtual directories , stuff that, in opinion.
see:
Comments
Post a Comment