Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Advantage of using IIS or Windows service for ServiceStack

I wrote a C# server application (windows service) that serves data through REST with ServiceStack to various clients (native applications written in .NET Compact Framework and Mono for Android). No web applications involved.

Would using IIS to host my server, instead of using it self hosted as windows service, would give me any advantage (speed, scalability, reliability) ?

Thanks!

like image 949
Mattia Durli Avatar asked Dec 01 '12 15:12

Mattia Durli


1 Answers

The benefits of using IIS is that it provides automatic management of ASP.NET hosts, e.g. it will recycle your AppDomain during idle times to reclaim server resources for un-used web hosts which also reduces the effects of memory leaks in your application code. It also imposes default request limits to protect against DDDOS attacks, and supports being able to re-deploy your app without downtime, i.e. pending requests hang until the new deployed application has started.

Self-Host HttpListener's major benefit is that they work without a web server. It doesn't include any HTTP Request restrictions which is a benefit if you want to support uploading large files. They're harder to re-deploy and will incur downtime during deployments.

like image 77
mythz Avatar answered Sep 24 '22 02:09

mythz