SharePoint Joel's SharePoint Land > Categories
Troubleshooting Indexing with ULS Log
I thought this addition deserved it's own post.  Not burried in the previous which again comes from Nick Hardin and Sam Crewdson's MS IT performance presentation AG207.  Not sure who gathered this, but this was in the appendix and not shared at the conference other than in the deck...
 
The following process can be used to figure out where search query time is being spent.
ULS logs should be on a separate fast drive
Set tracing level for MS Search Query Processor category to High.
01/23/2008 19:29:28.42  w3wp.exe (0x0680)   0x13C8    
Search Server Common MS Search Query Processor    0    High        
Completed query execution with timings: 437 328 297 234 172 124 - File:c:\o12sp\dev12sp\search2\ytrip\tripoli\icommand\qp.cxx Line:1750
The 5 numbers v1,v2,v3,v4,v5, v6 (in the sample above 437 328 297 234 172 124) are time measurements in milliseconds

V1 = Total time spent in QP. V2-V1 = Time spent retrieving properties and hit highlighting.
V2 = Latency of the query measured after the duplicate detection. V3-V2 = Duplicate detection time
V3 = Latency of the query measured after security trimming. It includes V4 plus retrieval of descriptors form SQL and access check. V3-V4 = Security Trimming time
V4 = Latency of the query measured after the joining of index results with the SQL part of the query. This includes V5 and the time spent in SQL for resolving the SQL part of advanced queries (e.g. queries sorted by date or queries including property based restrictions like AND size > 1000).  In short: V4-V5 = Join time
V5 = Time spent waiting for the full-text query results from the query server (time spent in index).
V6 = Cumulated time spent in various  calls to SQL except the property fetching.
Then use the logparser on it !!!!
 
LogParser "Select Timestamp, Extract_token(Message,6, ' ') as TotalQPTime, Extract_token(Message,10, ' ') as TimeSpentInIndex from '<servername>-<output-format>.log' Where Category = 'MS Search Query Processor' AND Message Like 'Completed query execution with timings:%'" -i:TSV -iCodepage:-1 -fixedSep:ON
Great MS IT Goodness on Search/Indexing Optimization From SPC
I was looking at the SharePoint Conference Deck from Nick Hardin and Sam Crewdson and found some golden nuggets in their deck as well as in the appendix that likely hasn't seen the light of day until the DVDs just went out.  Now it's totally public... like it wasn't before :)
 
I'm a bit supprised some of this hasn't made it to the blogosphere, but I wanted to give them credit for sharing their findings or at least their gleanings from their own tests, reverse engineering or from their conversations with Devs, PMs, Testers or whoever.
 
I'm sure Corey Burns should get some credit and even Andre Heymann who I'm sitting with in his apartment in Zurich wants some credit.
 
Maximizing Indexing Performance on Servers with 64 bit and 8GB or more RAM.  Improves speed.  (Obviously I have to really caution you since this is registry and you should not do this in production without testing it first, and always remember to back up your registry first!)
 
RegKeyName  RegKey Value (Decimal) Suggested Value (Decimal)
DedicatedFilterProcessMemoryQuota  104,857,600 209,715,200
FilterProcessMemoryQuota  104,857,600 209,715,200
FolderHighPriority 50 500

Reporting samples with LogParser

Looking for Cheap Reporting?  Look no further than the text based log parser.  When you're ready for real reporting then check out Nintex Reporting :)

Top 10 users sorted by alias
logparser.exe "SELECT TOP 10 cs-username, count (*) AS TOTAL from \\servername\logshare\W3SVC\ex080215.log group by cs-username order by TOTAL desc“

Top 100 hits by Username
logparser.exe "SELECT top 100 * from \\servername\logshare\W3SVC\ex080215.log where cs-username like '%%username' order by time desc“

Number of hits by IP Address
logparser.exe "select count (*) as number, cs-host, cs-username, c-ip, cs-uri-stem from \\servername\logshare\W3SVC\ex080215.log group by c-ip, cs-host, cs-username, cs-uri-stem order by number desc“

Number of hits by URL match
Logparser.exe "SELECT count (*) from \\sp-sfw-r07\e$\WWWLog\W3SVC\ex080228.log where cs-uri-stem like '%%userprofileservice.asmx'"