ASMX Web Service slow first request

后端 未结 7 1842
迷失自我
迷失自我 2020-11-27 16:33

I have a bunch of .NET Webservices running in one IIS Application. These webservices are consumed by another IIS Application (frontend). The first call is pretty slow, about

7条回答
  •  猫巷女王i
    2020-11-27 17:31

    The first time you call the webservice, or the first time after a long delay, the web service needs to start up. This is where you're seeing the delay. After that, it's already started and will respond really quickly to calls. This is standard web service behaviour.

    You could configure IIS to have keepalive = true - which may improve the performance.

    More information as requested.

    It could be that the serialization assemblies are being created at runtime. You can change the settings of the serialization assembly using the dropdown at the bottom of the Build pane of the properties window for the project.

    It could be that you have written your web service to perform a lot of operations on application start, which would happen the first time a method on the service is called.

    It might be that the operation is very slow, but you are then caching the response, which makes subsequent calls faster.

提交回复
热议问题