Tuesday 25 September 2012

How to capture Memory Dumps of slow performing Url requests using Debug Diagnostic 1.2.



You may come across scenarios when end users report intermittent performance degradation of your web application or web site but you have been unable to identify the cause.

One technique of capturing performance issues is to use the Microsoft trouble shooting tool






Action Plan

1. If you haven’t already, please download and install DebugDiag 1.2 onto the target web server:


http://www.microsoft.com/en-us/download/details.aspx?id=26798
2. Open up DebugDiag from the start menu.
3. When it launches the new rule wizard should automatically start, if it doesn’t then click the Add Rule button on the Rules tab.
4. In the Select Rule Type page select the second radio button named Performance and click Next.







5. Select Http Response Times and click next.



6. Now click the Add Url button. This opens the Properties of URL to monitor dialog box. Leave the top radio button selected, to use ETW, then in the Partial URL segment to match text box type in "/MyVirtualDirectory/" without quotes, then change the timeout after value to 20 seconds as shown in the screenshot below, then click OK.

7.





8. Back on the Select URLs to monitor wizard page click Next to continue.
9. Click the Add Dump Target button. Change the Target Type dropdown menu to Web Application Pool, then select the application pool that hosts your Web application\Web site, then click OK.






 



10. Click the Add Dump Target button again. Change the Target Type dropdown menu to Web Application Pool, then select your application pool which hosts your front end ASPX pages. We want to dump both the client and the web service processes when there is a delay so we’ve added two dump targets to this rule. Simply click Next to continue.


11. Change the generate a UserDump every value to 5 seconds, change the stop after generating value from 10 to 6 user dumps, then in the bottom section of the "Configure UserDump Series" wizard page, please select the radio button to "Collect Full UserDumps", like in the screenshot below. Then click Next.



 



12. Note, and change as needed, the location of where the Userdump files will get written to when the triggers fire and dumps are collected. Then click next.


13. Leave the Activate the rule now radio button selected and click Finish.

 

At this stage DebugDiag is attached to the application pool hosting your web application\web site. Any time one of those requests execute longer than 20 seconds then DebugDiag will generate full user dumps of that app pool, wait 5 seconds and dump the same two processes again.

When we have those dumps collected, then we can verify that the app pool still shows the ASPX request waiting and then we should be able to figure out what is causing the delay in the request.





 

Wednesday 19 September 2012

Using Web Services with SSIS Vb.Net






Using Web Service in SSIS with VB.NET script



SSIS provides two methods of handling Web services.
 
One option is the GUI Web service task that allows you to enter the Url of the Web service in a text box and select from a drop down box the list of methods it contains.
 
This approach is useful if it's a straight forward call to a Web service that requires minimal intervention on part of the SSIS package.

 
The second alternative is to use VB.Net to call the Web Service.
This is useful if there is more of an requirement to manipulate the source or destination data.
When working with VB.netin SSIS it might become apparent, how does SSIS know the methods of the Web Service.
 
You cannot start using the methods in the VB.Net script as its doesn't know what they are.
This is when a Proxy Class is used. This contains the definitions\properties of the Web Service.
To setup the Proxy Class one technique is to use the
Wsdl.exe tool.
 
Usually located under directory C:\Program Files\Microsoft.NET\SDK\....\Bin.
It's useful to generate the Web Service Contract file locally onto your machine.
 
You would run the following command in the command prompt to generate the Wsdl contract file onto your targer machine.
 
wsdl /language:VB /out:myProxyClass.vb http://hostServerUrl/WebserviceUrl/WebServiceName.asmx?WSDL
 
Then in the SSIS VB.Net IDE, you would add the Wsdl contract file by selecting the "Add Existing Item" and choose your newly generated wsdl file.
 






You will now have the Proxy Class so you can begin to use the methods of the Wsdl in your VB.Net script.

You will still need to code the Url of the Web Service within the script to interact directly with the Web Service host.

Some suggestions are the Url can come in the form of a SSIS variable, Config file entry or whichever is best suited for your application.





Thursday 13 September 2012





Restoring system database on Sql Cluster.





When dealing with system database restore on a cluster environment, this requires additional steps compared against a standalone environment.  When you try to connect to the clustered sql instance in single user mode, you most likely will get the message .






Login failed for user Xyz. Reason: Server is in single user mode. Only one administrator can connect at this time.

 



 

This is usually because the NT Authority \ System account is already connected to the instance, preventing you from connecting.




Solution:

Stop the sql server instance on the cluster resource.
 
Open an command prompt and start the sql instance in single user mode by running the following command.

%programfiles%\Microsoft SQL Server\MSSQL.X\MSSQL\Binn>sqlservr -m -s MyVirtualServerName\MySqlInstance

(The sqlservr .exe to run is usually located under the directory %programfiles%\Microsoft SQL Server\ MSSQL.X , X being the number of the intended Sql instance)

 
When the sql instance had started in single user mode
 
Open another command prompt and use SqlCmd to connect to the sql instance.
 
sqlcmd -S MyVirtualServerName\MySqlInstance -E

now run the restore command in sqlcmd for the master database



The system database should now be restored.