Sunday, November 27, 2016

Large time-taken value in IISlogs do not per se mean an issue on IIS / SharePoint server level

The time-taken field measures the length of time that it takes for a request to be processed. The client-request time stamp is initialized when HTTP.sys receives the first byte of the request. HTTP.sys is the kernel-mode component that is responsible for HTTP logging for IIS activity. The client-request time stamp is initialized before HTTP.sys begins parsing the request. The client-request time stamp is stopped when the last IIS response send completion occurs.
In the IIS logs of our SharePoint WFEs I observed large time-taken values for the responses of several GET requests, with times above 2500 (!!) seconds.
LogParser.exe "SELECT TOP 10 date,time,c-ip,cs-uri-stem,sc-status,sc-substatus,time-taken from u_ex*.log WHERE time-taken > 2500000 ORDER BY time-taken DESC"
We investigated whether this points to an actual performance problem on SharePoint server side, or is merely to be considered a false positive wrt the performance of the SharePoint environment. An indication of the latter is that our end-users have not reported (complained) on reoccuring long wait times for these requests. After some lengthy investigation - the observed symptom is not well documented -, we conclude to the last.
The justification for this conclusion is a) that we did not identify any performance issue due these specific requests on the SharePoint WFEs, and b) that beginning in IIS 6.0, the time-taken field typically includes “all the network time” being spent when transferring all the bytes to/from client:
HTTP.sys waits for the client to acknowledge the last response packet send operation or HTTP.sys waits for the client to reset the underlying TCP connection, before it logs the value for process duration in the time-taken field in the IIS logs.
This correlates with our observation that the longer time-taken responses were all for the download of large static files, typical powerpoint files (.pptx), that are rendered in browser via Office Web Apps (OWA). It appears that the browser on occassion takes long time before it completely processed the received file response, and acknowledges the last packet.

Wednesday, November 16, 2016

Recipe to duplicate InfoPath ListForm template for another content type

Context:
  • Crafted a rather rich and extensive InfoPath ListForm for content type <X>
  • Business requests similar but slightly different form for content type <Y>
Difficulties
  • InfoPath Designer does not provide a native capability to duplicate an InfoPath form to another content type
  • Drag-and-Drop from source InfoPath form template opened in InfoPath Designer to destination form template is limited, incomplete layout, no controls binding, ...
Pragmatic recipe for InfoPath Form copy
  1. Navigate to SharePoint List in a browser
  2. Go to 'List settings' \ 'Form Settings'
  3. Select content type <X>, the associated form opens in InfoPath Designer
  4. Save the template.xsn on a local location (or 'Save as' of the "source files")
  5. Return to 'List settings' \ 'Form Settings'
  6. Select content type <Y>, and select to create new form in InfoPath
  7. Immediate save as template.xsn on a local location, but make sure not to overwrite the one of <X>
  8. Navigate in Windows Explorer to the location(s) where you saved the .xsn files
  9. Rename the .xsn file-extension into .cab
  10. Extract both template.cab archives to local folders
  11. Open the folder of template for <Y>, and open template.xsf file in an editor. Lookup 'ContentTypeID' in the file, and copy the value
  12. Open the folder of template for <X>, and open template.xsf file in an editor. Lookup 'ContentTypeID' in the file, and paste the value copied from <Y>. Save the file.
  13. Make sure to reassign 'Open with' file association for template.xsf file to InfoPath Designer
  14. Double click the modified template.xsf file, and click 'Design' to open in InfoPath Designer
  15. Publish the InfoPath form to SharePoint List
Pragmatic recipe for partial InfoPath Form copy/reuse
  1. Step 1-10 as above
  2. Open the folder of template for <Y>, open in an editor the view.xsl for which you want to reuse layout from the form template of content type <X;>, and delete all content
  3. Open the folder of template for <X>, open in an editor the view.xsl that you want to reuse, select all file content for copy
  4. Paste the copied file content in the opened view.xsl of content type <Y>, and save the file
  5. Repeat this for every view in the form template that you want to duplicate/reuse
  6. Double click the modified template.xsf file, and click 'Design' to open in InfoPath Designer
  7. Publish the InfoPath form to SharePoint List