<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.technet.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html">IIS, Asp, Asp.Net and other cool stuff [ from the field @ LatAm  ]</title><subtitle type="html" /><id>http://blogs.technet.com/w3field/atom.xml</id><link rel="alternate" type="text/html" href="http://blogs.technet.com/w3field/default.aspx" /><link rel="self" type="application/atom+xml" href="http://blogs.technet.com/w3field/atom.xml" /><generator uri="http://communityserver.org" version="2.1.61025.2">Community Server</generator><updated>2007-08-22T19:17:00Z</updated><entry><title>Another post about logparser</title><link rel="alternate" type="text/html" href="http://blogs.technet.com/w3field/archive/2009/08/14/another-post-about-logparser.aspx" /><id>http://blogs.technet.com/w3field/archive/2009/08/14/another-post-about-logparser.aspx</id><published>2009-08-14T19:59:00Z</published><updated>2009-08-14T19:59:00Z</updated><content type="html">&lt;p&gt;Ok, probably you’d seen dozens of posts about using logparser. So, I’ll explain my scenario and how it was “easy” to solve it using a custom logparser query.&lt;/p&gt;  &lt;p&gt;My customer had an issue in his IIS5 WebServer and all request were returning a http status 404. In some instant of time, they fixed the issue and then the server went back online. &lt;/p&gt;  &lt;p&gt;Now the question is: was the server experiencing 404’s together with 200’s , or only 404’s? To answer this it would be great to have a single graphic where I could see all the 200 and 404 requests. This could be done easily with the following logparser query:&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;Logparser &amp;quot;SELECT      &lt;br /&gt;TO_LOCALTIME(QUANTIZE(TO_TIMESTAMP(date, time), 60)) AS Minutes,       &lt;br /&gt;sum(s200) as http_200,       &lt;br /&gt;sum(s404) as http_404       &lt;br /&gt;&lt;b&gt;USING&lt;/b&gt;&amp;#160; case sc-status when 200 then 1 else 0 end as s200,       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; case sc-status when 404 then&amp;#160; 1 else 0 end as s404       &lt;br /&gt;INTO http_status.gif       &lt;br /&gt;FROM ex*.log       &lt;br /&gt;GROUP BY Minutes&amp;#160; ORDER BY Minutes&amp;quot; -i:W3C -o:CHART -charttype:Line -groupsize:1600x480       &lt;br /&gt;-chartTitle&amp;#160; &amp;quot;STATUS HTTP (200 x 404)&amp;quot;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;This query creates something like this: &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://blogs.technet.com/blogfiles/w3field/WindowsLiveWriter/Backblogging_A328/image_2.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.technet.com/blogfiles/w3field/WindowsLiveWriter/Backblogging_A328/image_thumb.png" width="490" height="150" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;We clearly could see that server was experiencing only 404s (purple line) and then application was fixed and the returned status code changed to 200’s (blue line).&lt;/p&gt;  &lt;p&gt;Last word: logparser rocks!&lt;/p&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3273591" width="1" height="1"&gt;</content><author><name>Paulo Teixeira</name><uri>http://blogs.technet.com/members/Paulo+Teixeira.aspx</uri></author></entry><entry><title>Identifying problems in ASP classic application - Part 1</title><link rel="alternate" type="text/html" href="http://blogs.technet.com/w3field/archive/2007/08/31/identifying-problems-in-asp-classic-application-part-1.aspx" /><id>http://blogs.technet.com/w3field/archive/2007/08/31/identifying-problems-in-asp-classic-application-part-1.aspx</id><published>2007-08-31T23:04:00Z</published><updated>2007-08-31T23:04:00Z</updated><content type="html">&lt;P&gt;Last week I was in a customer that was experiencing a sort of problems in his website. It was a very complex situation, with an ASP-classic application using several bad practices in his code. &lt;/P&gt;
&lt;P&gt;However, the major problem is that customer has no idea about errors in his application. To him, the problem was caused by Microsoft SQL Server hitting 100% CPU usage. &lt;/P&gt;
&lt;P&gt;A short exam of IIS and event logs shown the problem was in the application code and not in IIS or even SQL. Of course, a log analysis is not a so simple task to&amp;nbsp;do&amp;nbsp;if you don't have the appropriate tool. &lt;/P&gt;
&lt;P&gt;Anytime I've to do this kind of&amp;nbsp;task,&amp;nbsp;I&amp;nbsp;use &lt;A href="http://www.microsoft.com/downloads/details.aspx?FamilyID=890cd06b-abf8-4c25-91b2-f8d975cf8c07&amp;amp;DisplayLang=en" mce_href="http://www.microsoft.com/downloads/details.aspx?FamilyID=890cd06b-abf8-4c25-91b2-f8d975cf8c07&amp;amp;DisplayLang=en"&gt;Microsoft LogParser&lt;/A&gt;. &amp;nbsp;There are a lot other tools&amp;nbsp;that could be used to achieve this, but Logparser really rocks! In special I link the fact you can use "SQL-like" syntax to obtain almost any information from several kinds of logs. &lt;/P&gt;
&lt;P&gt;So, going to the real thing, a simple logparser query&amp;nbsp;used to read and process an IIS W3C Extended Log file looking for&amp;nbsp;errors registered is shown below: &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN lang=EN style="FONT-SIZE: 11pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: en; mso-fareast-language: en-us; mso-bidi-language: ar-sa"&gt;&lt;SPAN lang=EN style="FONT-SIZE: 8pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: en; mso-fareast-language: en-us; mso-bidi-language: ar-sa; mso-bidi-font-size: 11.0pt"&gt;logparser "select cs-uri-stem, sc-status,sc-win32-status,COUNT(cs-uri-stem) from&amp;nbsp;&amp;lt;IIS_LOG_FILE.LOG&amp;gt; to errors.csv where sc-status &amp;gt;= 400 GROUP BY cs-uri-stem,sc-status,sc-win32-status ORDER BY COUNT(cs-uri-stem) DESC" -o:CSV&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;This gave me a&amp;nbsp;lot of URLs with 500 errors. From this point, I also had started checking other things and also had found several errors in&amp;nbsp;application event log. Looking at application event log I'd also found several entries similar to: &amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-ansi-language: en-us"&gt;8/20/2007&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;4:49:39 PM&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Active Server Pages&lt;SPAN style="mso-tab-count: 1"&gt; &lt;/SPAN&gt;Warning&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;None&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;9&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;N/A&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;SERVER_01&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Warning:&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;500 Server Error. .&lt;SPAN style="mso-tab-count: 4"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-ansi-language: en-us"&gt;8/20/2007&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;4:49:25 PM&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Active Server Pages&lt;SPAN style="mso-tab-count: 1"&gt; &lt;/SPAN&gt;Warning&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;None&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;9&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;N/A&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;SERVER_01&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Warning: File /search_payment.asp Line 29 Type mismatch: 'fValidateC'. .&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-ansi-language: en-us"&gt;8/20/2007&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;4:48:58 PM&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Active Server Pages&lt;SPAN style="mso-tab-count: 1"&gt; &lt;/SPAN&gt;Warning&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;None&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;9&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;N/A&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;SERVER_01&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Warning: File /basket_001.asp Line 33 Type mismatch: 'oBasket.Item(...)'. .&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-ansi-language: en-us"&gt;8/20/2007&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;4:48:48 PM&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Active Server Pages&lt;SPAN style="mso-tab-count: 1"&gt; &lt;/SPAN&gt;Warning&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;None&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;9&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;N/A&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;SERVER_01&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Warning: File /finalizebuy01_.asp Line 304 Type mismatch: 'oBasket.Item(...)'. &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'"&gt;&lt;FONT color=#ff0000&gt;[Page names, server names and other sensitive information was changed to prevent customer identification]&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV&gt;
&lt;P&gt;At this point&amp;nbsp;I'd realized the&amp;nbsp;problem was in their application.&amp;nbsp;So, I'd two approaches&amp;nbsp;that could be used to identify the problem: &lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;a) execute a dynamic analysis, I mean, getting a memory dump of process and analyzing it (or a set of memory dumps).&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;b)&amp;nbsp;execute a static analysis, I mean, a code review. &lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;My first idea was get&amp;nbsp;memory dumps when error 500 happens; When doing this, the first thing to check (before get the dump) is the possible size of dump file. It's very easy to do this: just check the object &lt;EM&gt;Process\Virtual Bytes&lt;/EM&gt; in PerfMon for&amp;nbsp;the process running the application code (in this&amp;nbsp;case, W3WP.exe); Ok, and how can I know what is the instance of W3WP.exe if I have several ones? Also, very easy: at command prompt, just call the&amp;nbsp;&lt;EM&gt;iisapp.vbs &lt;/EM&gt;command. The result will be a list with Application Pools names and correspondent Worker Process PIDs.&lt;/P&gt;
&lt;P&gt;When I checked this information, I&amp;nbsp;found a impressive result: 1.8Gb of VM usage for the process hosting the application; never had seen this before. Obviously there was a problem there, and get a memory dump was not a good option at this point (why? because the dump file&amp;nbsp;would have 1.8Gb or more in size, and this could take a loooong time to be generated).&lt;/P&gt;
&lt;P&gt;After some discussion with customer, I'd opted to executed the second option,&amp;nbsp;also because the system is very critical and get a memory dump obviously might cause an unacceptable outage&amp;nbsp;to them&amp;nbsp;(Later I'll post other entry about this code review where I'd realized why so many VM memory was in use).&lt;/P&gt;
&lt;P&gt;
&lt;TABLE class=MsoTableMediumGrid1Accent6 style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-border-alt: solid #F9B074 1.0pt; mso-border-themecolor: accent6; mso-border-themetint: 191; mso-yfti-tbllook: 1184; mso-padding-alt: 0in 5.4pt 0in 5.4pt" cellSpacing=0 cellPadding=0 border=1 class="MsoTableMediumGrid1Accent6"&gt;
&lt;TBODY&gt;
&lt;TR style="mso-yfti-irow: -1; mso-yfti-firstrow: yes; mso-yfti-lastrow: yes"&gt;
&lt;TD class="" style="BORDER-RIGHT: #f9b074 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f9b074 1pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #fde4d0; PADDING-BOTTOM: 0in; BORDER-LEFT: #f9b074 1pt solid; WIDTH: 458.3pt; PADDING-TOP: 0in; BORDER-BOTTOM: #f9b074 1pt solid; mso-border-themecolor: accent6; mso-border-themetint: 191; mso-background-themecolor: accent6; mso-background-themetint: 63" vAlign=top width=675&gt;
&lt;P style="mso-yfti-cnfc: 5"&gt;&lt;B&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-ansi-language: EN-US"&gt;&lt;BR&gt;Lessons from this post: &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P style="mso-yfti-cnfc: 5"&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-ansi-language: EN-US; mso-bidi-font-weight: bold"&gt;a) Look at IIS Logs for errors 500; use MS Logparser to do it. &lt;BR&gt;b) Look at Application event logs for errors/warnings in source &lt;EM&gt;&lt;SPAN style="FONT-FAMILY: 'Arial','sans-serif'"&gt;Active Server Pages&lt;/SPAN&gt;&lt;/EM&gt;. Also you can use MS LogParser;&lt;BR&gt;c) Before get a memory dump, check the VM memory usage of Worker Process; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN lang=EN-US style="mso-ansi-language: EN-US"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;to be continued...&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=1870624" width="1" height="1"&gt;</content><author><name>Paulo Teixeira</name><uri>http://blogs.technet.com/members/Paulo+Teixeira.aspx</uri></author></entry><entry><title>Started blogging!!!!</title><link rel="alternate" type="text/html" href="http://blogs.technet.com/w3field/archive/2007/08/22/started-blogging.aspx" /><id>http://blogs.technet.com/w3field/archive/2007/08/22/started-blogging.aspx</id><published>2007-08-22T21:17:00Z</published><updated>2007-08-22T21:17:00Z</updated><content type="html">&lt;P&gt;Hi everybody,&lt;/P&gt;
&lt;P&gt;This is my first post. I think it's necessary a small presentation about myself and about the subject of this blog. I'm Paulo, and I'd worked as a Field Enginner at Microsoft living in Brazil and working in the LatAm area. (I was thinking about the language to be used in the blog: portuguese or english, but due the broader audience I've&amp;nbsp;decided by english ;-) ...)&lt;/P&gt;
&lt;P&gt;I've been working with &lt;STRONG&gt;IIS&lt;/STRONG&gt; and &lt;STRONG&gt;web related technologies&lt;/STRONG&gt; like asp, asp.net, COM+, webservices and others, since a few months later I'd joined to Microsoft.&lt;/P&gt;
&lt;P&gt;So, the major objective of this blog is to be a place where you can find information about our experiences in the field; I'll try to bring to here situations&amp;nbsp;we've been found in the field in the several environemnts and customers&amp;nbsp;we support in LatAm. Also I'll &amp;nbsp;try to bring my own experience about the products we work with including architecture and operational tips and tricks.&lt;/P&gt;
&lt;P&gt;For now, I'm working the first "technical" post and as soon it becomes ready I'll post it.&lt;/P&gt;
&lt;P&gt;See you soon.&lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=1804083" width="1" height="1"&gt;</content><author><name>Paulo Teixeira</name><uri>http://blogs.technet.com/members/Paulo+Teixeira.aspx</uri></author><category term="blogging" scheme="http://blogs.technet.com/w3field/archive/tags/blogging/default.aspx" /></entry></feed>