Why it's so slow when a wcf client connects to the service?

后端 未结 3 2097
北恋
北恋 2021-01-06 07:50

I met a performance issue when using the WCF service.

Here\'s the story:

  1. I wrote a self-hosted WCF service which is hosted by a console application

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-06 08:30

    One way could be to add your own warmup script; a script that calls your service on initial load.

    Though, this answer might help you, usually, the first access to the service is slow, but the consecutive accesses would be within a sec or two.

    The first slow response is related to the JIT compilation of the service assemblies; which means its normal.

    Alternatively, you may want to Profile you app. Also you may would like to checkout this article that I wrote some time back.

提交回复
热议问题