Delay in loading page of a website published through UAG
When we publish a website(including exchange services and share point services), UAG does lot of processing ,in fact parsing of the content and links in the pages ,when a user accesses these pages through UAG.
I came across a case, where we experienced delay after user logs in to the website and the page loads on the browser.
To understand where delay was happening, I used a tool called HTTPwatch on the client side and for deeper fact finding on a possible cause on server side, took UAG trace, with all filters. You can refer to Ben ari's blog post about UAG tracing https://blogs.technet.com/b/ben/archive/2010/09/03/uag-tracing-made-simple.aspx.
In the HTTPWatch I found delay in the URL, which we can see in following snapshot.
Then in the UAG tracing I found delay when this page was getting parsed
****************************************************************************************
Info:MatchServer(a.contoso.com, 80, 0): took 5566 milliseconds
Info:MatchServer(b.fabrikam.com,80, 0): took 20 milliseconds
Info:SearchAndReplaceURLLocation(/examplepath/):took 5676 milliseconds
Info:SearchAndReplaceURLLocation(/examplepath/): took 4565 milliseconds
Info:MatchServer(x.fabrikam.com,80, 0): took 5253 milliseconds
Info:ProcessBuffer(/examplepath/):took 8556 milliseconds
Info:took 8556milliseconds
Info:SearchAndReplaceURLLocation(/examplepath/examplefile):took 25 milliseconds
****************************************************************************************
Note: simplifying the numbers, 5676 milliseconds is actually 5.676 seconds.
Here while parsing UAG is trying to resolve names of servers/hostnames in the links it encounters in the page its parsing, here our problem page.
I confirmed this delay in the network traces taken at the time of the issue, putting one of the name resolution conversation from network traces below, we can see delay of 11 seconds and finally response from DNS server as server failure i.e. it could not resolve name.
*******************************************************************************
20:47:29 PM 1/2/2013 xxxx DNS DNS:QueryId = 0xA888, QUERY (Standard query), Query for a.contoso.com of type Host Addr on class Internet {DNS:xx, UDP:xx, IPv4:x}
20:47:40 PM 1/2/2013 xxxx DNS DNS:QueryId = 0xA888, QUERY (Standard query), Response - Server failure {DNS:xx, UDP:xx, IPv4:x}
*******************************************************************************
So provided following suggestions to the Admin
1. for testing and as work around, skip body parsing for this URL(seen in httpwatch, where we see delay).
2. Get the name resolution fixed on the DNS server or use host file for the names which are not getting resolved, due to which delay in loading of page is happening.
Our testing of skip body parsing for this URL worked and we got rid of the delay, then Admin worked on the DNS name resolution for permanent fix of the problem.