Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Performance problems with WebAPI using a huge Proxy Class

$
0
0

Hi there,

I have written an ASP.NET Core WebAPI interface to enable other applications accessing a central application's data. This is done by consuming a SOAP web service. So I used Visual Studio to generate a Proxy Class for this web service. This Service Reference has around 1.5Mio lines of code and so it takes quite long to compile in first place.

But the problem occurs during runtime: The first start always takes a bit longer because of JIT compilation, but in this case, when I call methods that use this background web service it takes 60 seconds for the first answer. After some time it seems that the GC is wiping the instance again and it takes again this amount of time for an answer. Inbetween there is no problem with performance, everything runs quite smooth.

Now the question is, how can I improve this behaviour?

What I tried yet:

  • Compiling the service reference into a separate DLL to minimize compilation times of the ASP.NET site because the backend web service will remain static. This helped for compilation time, but not at runtime
  • Playing around with NGEN to generate a native image on the target server. But this fails with a lot of missing dependent assemblies of .NET Core, like System.Model.Primitives and so on. So the native image is never being used

In ASP.NET I already included the client instance as a Singleton in StartUp.cs

Could anybode give me hint, how I could improve performance? Because atm this is not acceptable.

Thanks in advance


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>