我有两个选择:
如果我自己托管Wep Api uisng OWIN/Katana,我可以提高性能,但是如上所述在这里,我必须编写代码来具有IIS的功能,例如日志记录,应用程序池扩展,限制等.
If I self host Wep Api uisng OWIN/Katana I can have the performance gain but as mentioned here, I have to write code to have the features of IIS like logging, application pool scaling, throttling etc.
我可以使用不使用不必要的System.Web请求管道的Asp.Net Core创建API吗?并使用IIS功能或Nginx服务器功能?
Instead can I create API using Asp.Net Core which doesn't use unnecessary System.Web request pipeline ? And use the IIS features or Nginx Server features ?
考虑到性能,哪个是最佳选择?
With performance in mind which is the best option ?
更新:
我的意思是,我不想使用IIS,但是我想使用自定义代码自托管具有IIS功能的Web API.还是Asp .NET Core可以帮助我在没有IIS和不必要的System.Web请求管道的情况下实现这一目标?
I mean , I don't want to use IIS , but i want to self host Web API with IIS features using custom code. or Will Asp .NET Core will help me to achieve this without IIS and unnecessary System.Web request pipeline ?
推荐答案出于以下原因,我建议选择选项2,即ASP.NET Core Web API
I recommend option 2 i.e. ASP.NET Core Web API for following reasons
- 现在ASP.NET Core 2已经发布,它更加专注于更好的性能.您的API构建将是最少的(可以吸收应用程序中使用的内容). 可以以最有效的方式构建
- 核心Web API. .NET Core代码可以帮助您在非Windows计算机上进行部署.
- API响应足够快,因为避免了管道中的许多瓶颈.
- Now that ASP.NET Core 2 is out, it focused more on the better performance. Your API build will be minimal (takes in whats used in the application).
- Core Web API can be built in most efficient way. The .NET Core code can help you deploy on non-windows machines.
- API response is fast enough as lots of bottlenecks are avoided in the pipeline.
通过对Kestrel的改进,使用ASP.NET Core 2很有好处.WebAPI可以托管在IIS/Nginx上,也可以很容易地独立存在.
With Kestrel improvements, it beneficial to use ASP.NET Core 2. The Web API can be hosted on IIS/ Nginx or stand alone pretty easily.
更多推荐
是否创建自托管Web API或使用Asp.Net Core Web API?
发布评论