Reputation: 2184
In my WebApi (.Net 4.6.2) I have an issue with one call that performs unexpectidly slow(~15sec). When I went to analyze it I found out that the code inside the call performs relatively fast( does db call & processing in < 200ms) and sends response back to the client.
I thought that serialization (I'm using JSON) takes a while to do. So i put a breakpoint into the GetObjectData()
method of the class that I'm trying to serialize. And it does its job in few milliseconds too.
After that if I let it run it still takes remaining time (around 14 seconds) to complete.(This time is pure wait on client side, no download happens)
How can i debug what happens after GetObjectData()
and identify the bottleneck?
Upvotes: 0
Views: 3851
Reputation: 5634
I would suggest installing fiddler and check clientBeginRequest and clientEndRequest values there as explained here.
If your web API is on HTTPs you can enable HTTPS interception enabled on Fiddler.
You can see the timers as shown below:
Then you can decide if the slowness is at server or it is in the client application.
You can also try calling your API through postman and check how much time it takes response to appear in postman.
If the issue is on server side, you can then add logging filters or HttpModules to see when request was received, when response was sent, how much time was taken by each method's execution. You should also check server CPU utilization and memory / disk usage to see if these are causing any issues in your APIs performance.
Hope this should help to localize the issue.
Upvotes: 1