Hosting in ASP.NET web app

Oct 27, 2010 at 9:10 AM

Pubsub systems often use console app or win service for broker (mediator) wcf service. Can it be hosted in plain-old web app, for easier usage on shared web hosting environments? 

Oct 27, 2010 at 6:50 PM
Edited Oct 27, 2010 at 6:51 PM


technically Laharsub could be hosted in IIS (at least as long as the protocol is HTTP based, which may change after introduction of WebSockets). However, there are a few reasons why this is not a deployment environment of choice:

  1. An ASP.NET application that implements UI which utilizes the pub\sub functionality of Laharsub will likely have lifecycle and scalability requirements that are distinctly different from those of the pub\sub component in most but the simplest of deployments. For example, a web chat application that targets a large number of users may require 2 ASP.NET UI backends and 7 pub\sub backends to support the expected load. Given that, any tight coupling between ASP.NET and Laharsub (e.g. running both in a single application domain) makes the system harder to scale out. Such applications should be designed with the principle of loose coupling between UI and pub\sub component. In the context of Windows Azure for example, I would expect a chat application to use the Web Role for ASP.NET UI component, and a Worker Role for the Laharsub pub\sub component.
  2. Laharsub could still be hosted in IIS standalone, without any coupling with ASP.NET UI. If you think this mode would be beneficial, I would like to find out more about the specific features offered in this hosting option that you find compelling and that are not available when self-hosting in a windows service (or Windows Azure Worker Role, or console application).
  3. Performance and scalability characteristics of Laharsub when hosted in IIS would likely be very different compared to the self-hosted case. IIS brings in additional layers of message processing that has not been optimized with the HTTP long polling pattern as the primary scenario in mind. As long as there is no or little value add of IIS hosting, I don't believe it is worth paying the performance cost.


Dec 9, 2010 at 7:21 PM

Hi Tomasz,

I am a relative newbie to the WCF/Services field. Never moved much beyond working through the standard example programs as in Loewy's books etc. I am now looking for a robust Pub/Sub framework to immerse myself into a more realistic scenario and hopefully something that I can move forward with as a final implementation platform fo my project.

So, In my case I do not have a server system available - at the moment - where I can play around with the Windows Services or selfhost on the Windows Sever I have access to. I am using th system where my non-profit hosts its blog, web-site, SQL spatial data base etc. I can only publish and manage web applications which is how I expose my "learning-services" to the Internet.

So while in the future I will definitely be looking into either self-hosting on an "self-managed-server" or Azure (AppFabric), I am trying to limit the number of unknowns to deal with - and Azure is a big unknown right now ;-( and a self-manage connected server I don't have right now. Performance and scalability characteristics of Laharsub are not that much of an issue right now since I am more at the educaton/learning/function/features stage than being concerned with performance and scalability.

An easy way to expose the LaharSub service through IIS would therefore be very helpful - well at least for me.

Just my 2c.

Thanks for the work on the LaharPubSub infrastructure - I certainly would never be able to come up with it myself.

Take care,

Vashon (WA) USA

Dec 10, 2010 at 6:58 AM


thank you for your feedback. Ability to use Laharsub hosted in IIS would indeed be useful in educational scenarios, I will keep this in mind when planning future work. 

I am curious what you project is about and what the non-profit organization's goals are?