Poor Web Service performance with larger requests
eknraw
Member Posts: 26
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:
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?
Thanks,
Bill
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> <ActivityType>ExecuteUserCode</ActivityType>
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?
Thanks,
Bill
0
Comments
-
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.
Bill0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions