2

I have a Self-Host OWIN http server basing on Microsoft.Owin.SelfHost v3.1.0 encountering performance issue. There are only a few hundreds requests but CPU went to 100% and the server cannot serve more requests.

All my methods are asynchronous and there is no blocking I/O operation.

By attaching a profiler when running load test, I get the following result. enter image description here

It surprises me my application code only takes up less than 10% CPU. Most of CPU time is consumed by the framework.

System.Net.ListenerAsyncResult.QueueBeginGetContext() consumes 35% OwinHttpListener.ProcessRequestAsync consumed 23%

It seems abnormal to me, but I don't know where the issue is.

Please does anyone has any idea?

Mr.Wang from Next Door
  • 13,670
  • 12
  • 64
  • 97
  • If you really want high performance HTTP service, use other approaches (like ASP.NET Core on HTTP.sys). OWIN self hosting was the first attempt and focus on the architectural changes, so performance is not of highest priority. – Lex Li Nov 24 '17 at 16:44
  • More history. Rick Strahl has performed several rounds of performance evaluation, https://weblog.west-wind.com/posts/2012/Sep/04/ASPNET-Frameworks-and-Raw-Throughput-Performance, https://weblog.west-wind.com/posts/2013/Nov/23/Checking-out-the-Helios-IIS-Owin-Web-Server-Host, and https://weblog.west-wind.com/posts/2013/Dec/09/Reexamining-ASPNET-and-Helios-Performance-Tests ASP.NET Core is the continuation of Helios project, so it should give you the results you want, while all previous attempts should be considered as done and legacy. – Lex Li Nov 24 '17 at 17:17
  • Thanks @LexLi, I changed from KATANA to Kestrel, and the throughput increased about 2.1x! very amazing – Mr.Wang from Next Door Nov 30 '17 at 07:51

0 Answers0