Please paste the permalink to the page in question below:
One of the test runs:
Please share your question/describe your issue below. Include any screenshots that may help us understand your question:
In one of our services, we are converting endpoints from using WCF to ASP.NET Web API. We have noticed that the transactions' response times reported in the New Relic APM have increased for these same endpoints. It has ranged from 1.5x to 4x slower for Web API vs WCF in our live production.
We ran load tests to compare two versions (WCF & Web API) of the same endpoints and New Relic consistently indicated WCF was faster than the Web API equivalent. For example, one of the tests executed 100K requests (for an hour) against both endpoints with the following results:
New Relic: avg response time
wcf --> 96.1 ms
web api --> 132 ms
However, the test project (specifically Visual Studio's Web Performance and Load Test Project) used to execute the tests recorded opposite results indicating that Web API was faster than WCF. For example:
Visual Studio load test project: avg test time
wcf --> 0.19 s
web api --> 0.16 s
We also confirmed using other http clients including Fiddler and Resharper Test Runner that Web API was slightly faster than WCF and not significantly slower (i.e. consistent with the results above).
Our expectation is that the Web API should perform as good or even better than WCF (since not SOAP and returns JSON payload) so we are surprised to see the metrics reported by New Relic to be significantly different especially when compared with results from client requests.
We tried and tested various changes to see if something else was a factor including removing servers' http request handlers, changing to faster json serializers used to create the response, and requesting from the client different media content types from JSON to XML. However, the results in New Relic are always the same.
Is it likely the WCF service instrumentation used by the New Relic .NET agents on the server captures the data differently that the instrumentation used for Web API? Is there something else going on? Should we be concerned about this discrepancy?