0

I was reading this article in looking for differences between creating an API using WebAPI and MVC and came across this statement:

In simple load testing on my local machine, I’ve found that Web API endpoints hosted in console apps are nearly 50% faster than both ASP.NET controller actions and Web API endpoints hosted within MVC projects.

As such, I'm interested in how this would take shape in a production environment.

Obviously I'm looking for performance, so I looked into OWIN and self-hosting. However I'm not clear on if this offers the same efficiency as the console app discussed above.

Can someone please explain the proposal of hosting an API console application for consumption in a production environment - i.e. how would you connect a URL to the console app, etc.?

Thanks.

ElHaix
  • 12,846
  • 27
  • 115
  • 203
  • What are you planning to host it in? Your own server? Azure? AWS? – Mick May 06 '16 at 00:02
  • This might help... http://stackoverflow.com/questions/31302499/unable-to-access-owin-self-hosted-restapi-deployed-to-aws-ec2-windows-2012-r – Mick May 06 '16 at 03:18
  • I think self hosting within a console is good for debugging and demos when you come to host it in production it's not going to be running in a console – Mick May 06 '16 at 03:19
  • Come to think of it, running it as a service may be the answer. – ElHaix May 06 '16 at 12:06
  • I'm working on a project at the moment using WebAPI 2 hosted in Azure using IIS, we have many thousand requests a second during the day and we've never worried about the speed of the hosting env (IIS), we have always looked towards DB and search index queries to gain on speed. And even then 90% of our endpoints return in less than 0.5 secs. Do you really need to worry that much about this?! – matt_lethargic Oct 14 '16 at 20:58

1 Answers1

0

My understanding is self hosted OWIN apps can be run within any kind of app domain e.g console, windows forms, windows service, AWS EC2, Azure Worker Role etc. The application you should run it in is dependent upon the hosting environment you choose, there are lots of options.

Mick
  • 6,527
  • 4
  • 52
  • 67