Poor Web Service performance with larger requests

eknraweknraw Member Posts: 26
edited 2010-05-13 in NAV Three Tier
I'll make this as brief as I can and if anyone has any ideas I can get a bit more specific. I'm noticing that incoming web service requests that start to get > 50KB have a lag time between the WCF service and execution of my AL code.

I have a codeunit exposed as a web service that accepts an XML string into a bigtext variable, loads that into a DOM object, does some processing and spits back a result.

With one particular function I added code to get the current time at the very beginning of the function and then at the end of the function, find the difference, append the duration to a log file written out to disk of the resultant dom xml. A crude performance measure.

From the time I see a larger request hit the network adapter (in wireshark) to when NAV sends a response back is about 70 seconds.
The XML file I write out to disk has a duration time of about 30 seconds. The request written to disk in UTF-8 format is about 290 KB in size.

If I read the same xml doc from disk, processing duration is about the same as measured going through the service tier, so the time measurements of the execution of my code seem somewhat accurate.

I've turned WCF tracing on and following the times as it's transfered from the WCF service to NAV and then from NAV to WCF is measured in milliseconds. In the WCF trace logs it's the time between the "Activity boundary" Start and Stop.

Maybe the most relevant part of the WCF log for the activity boundry both start/stop:
<ActivityName>Execute 'Microsoft.Dynamics.Nav.Service.WebServices.IUniversalContract.ProcessMessage'.</ActivityName>

I don't know of a way to gain visibility into what happens at this point but I'm guessing it get's passed to the NAV code/business logic layer? Any ides on what might be going on in the service tier that I'm losing about 40 seconds before this request hits my application code?




  • Options
    eknraweknraw Member Posts: 26
    I haven't solved this yet but I think I might finally on the right track. This also might be related to: http://www.mibuso.com/forum/viewtopic.php?f=32&t=38448

    If I set the Service tier to use NTLM in CustomSettings.config <add key="WebServicesUseNTLMAuthentication" value="true"></add> and fire my request directly into NAV from SoapUI, everything happens quickly as I'd expect.

    What I can't explain is why every request wouldn't have the same 15-20 second overhead before it hits my AL code. Well, I can't even explain why the overhead exists at all at this point.

    Time to get some of the network guys involved that know more about NTLM/Kerberos than I do. :)

Sign In or Register to comment.