<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Ran's blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/performance_tuning_of_sql_azure1/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/performance_tuning_of_sql_azure1/feed.xml</link>
    <description />
    <lastBuildDate>Wed, 17 Apr 2019 03:48:39 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Elastic processing with PowerShell in Windows Azure HDinsight</title>
      <link>https://docs.microsoft.com/archive/blogs/performance_tuning_of_sql_azure1/elastic-processing-with-powershell-in-windows-azure-hdinsight</link>
      <pubDate>Tue, 28 Apr 2015 07:57:00 GMT</pubDate>
      <dc:creator><![CDATA[Mars.zhai]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/performance_tuning_of_sql_azure1/2015/04/28/elastic-processing-with-powershell-in-windows-azure-hdinsight/</guid>
      <description><![CDATA[Azure HDInsight is Hadoop in the cloud, built to handle any amount of relational or non-relational...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Azure HDInsight is Hadoop in the cloud, built to handle any amount of relational or non-relational data, scaling from terabytes to petabytes on demand.HDInsight allows customers to deploy a variety of cluster types, for different data analytics workloads.Each cluster type consists of a set of nodes. Customers are billed for the usage of those nodes for the duration of the cluster&rsquo;s life. Billing starts once a cluster is created and stops when the cluster is deleted .So to reduce cost of the cluster,automatically management is very necessary in HDinsight.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Powershell is a very useful&nbsp;tool&nbsp;to implement elastic processing.Here I want to share with&nbsp;you some useful PowerShell script:</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Firstly,we need to set up variables used to create an HDinsight cluster:</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; background-color: #ffff00;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/78/8156.1.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-78/8156.1.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/78/8156.1.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-78/8156.1.png" alt="" border="0" /></a></span></p>
<div><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Make sure the storage account exists:</span></div>
<div><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/78/3718.2.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-78/3718.2.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/78/3718.2.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-78/3718.2.png" alt="" border="0" /></a></span></div>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Remove the cluster if it already exists:</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/78/1526.3.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-78/1526.3.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/78/1526.3.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-78/1526.3.png" alt="" border="0" /></a></span></p>
<pre class="scroll"><code class="js"></code><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">&nbsp;Create a cluster</span></pre>
<pre class="scroll"><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/78/8688.4.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-78/8688.4.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/78/8688.4.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-78/8688.4.png" alt="" border="0" /></a></span></pre>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">After creating the cluster,we'll use the cluster to analyse the file 'sample.log'.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">The file is just like this:</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/78/1588.5.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-78/1588.5.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/78/1588.5.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-78/1588.5.png" alt="" border="0" /></a></span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Then&nbsp;we need to upload the log from local workstation to blob container:</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/78/6443.6.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-78/6443.6.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/78/6443.6.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-78/6443.6.png" alt="" border="0" /></a></span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Set up the pig job and the query:</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/78/4477.7.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-78/4477.7.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/78/4477.7.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-78/4477.7.png" alt="" border="0" /></a></span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Submit the pig job and download the result,display the result in our powershell:</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/78/7242.8.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-78/7242.8.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/78/7242.8.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-78/7242.8.png" alt="" border="0" /></a></span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">The result should be like this:</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/78/0334.9.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-78/0334.9.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/78/0334.9.jpg" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-78/0334.9.jpg" alt="" width="371" height="92" border="0" /></a></span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Remove the cluster after we complete our job:</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/78/2273.9.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-78/2273.9.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/78/2273.9.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-78/2273.9.png" alt="" border="0" /></a></span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Finally,we&nbsp;completed our HDinsight job using PowerShell.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">You can download the script from the attachment.Hope this demo will be helpful to you.</span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/10/61/03/96/PowerShellAutomation.ps1" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-10-61-03-96/PowerShellAutomation.ps1">PowerShellAutomation.ps1</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Performance tuning methodology of SQL Azure</title>
      <link>https://docs.microsoft.com/archive/blogs/performance_tuning_of_sql_azure1/performance-tuning-methodology-of-sql-azure</link>
      <pubDate>Tue, 28 Apr 2015 03:07:00 GMT</pubDate>
      <dc:creator><![CDATA[Mars.zhai]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/performance_tuning_of_sql_azure1/2015/04/28/performance-tuning-methodology-of-sql-azure/</guid>
      <description><![CDATA[Designing for high performance is becoming more important when using a database running in the cloud...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Designing for high performance is becoming more important when using a database running in the cloud because development objectives tend to minimize roundtrips and the amount of data being returned.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Performance tuning is a very complex topic,in this article,I will only introduce some selected techniques.Many techniques presented here are similar to the ones available in on premise SQL Server,though some of the tools aren't supported in SLQ Azure.</span></p>
<p>&nbsp;</p>
<p><span style="font-family: arial,helvetica,sans-serif;"><strong><span style="font-size: large;">Methods and Tools</span></strong></span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Because SQL Azure is a hosted and shared infrastructure ,it's importnat to understand which tuning methods are available and which aren't.The below table outline some of the key methods traditionally used by developers and DBAs in tuning a database system.</span></p>
<table style="width: 1134px; height: 182px;">
<tbody>
<tr>
<td><span style="font-size: medium;"><strong><span style="font-family: arial,helvetica,sans-serif;">Method or Tool</span></strong></span></td>
<td><strong><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">&nbsp;Available?</span></strong></td>
<td><strong><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">&nbsp;Comments</span></strong></td>
</tr>
<tr>
<td><span style="font-family: arial,helvetica,sans-serif;">&nbsp;SQL Profiler</span></td>
<td><span style="font-family: arial,helvetica,sans-serif;">&nbsp;No</span></td>
<td><span style="font-family: arial,helvetica,sans-serif;">&nbsp;Tools using server-side traces,such as most auditing tools,SQL Profiler,and the Index Tuning Wizard,aren't supported</span></td>
</tr>
<tr>
<td><span style="font-family: arial,helvetica,sans-serif;">&nbsp;Execution Plan</span></td>
<td><span style="font-family: arial,helvetica,sans-serif;">&nbsp;Yes</span></td>
<td><span style="font-family: arial,helvetica,sans-serif;">&nbsp;SQL Server Management Studio can display actual execution plans against a SQL Azure database.</span></td>
</tr>
<tr>
<td><span style="font-family: arial,helvetica,sans-serif;">&nbsp;Perfmon</span></td>
<td><span style="font-family: arial,helvetica,sans-serif;">&nbsp;&nbsp;No</span></td>
<td><span style="font-family: arial,helvetica,sans-serif;">&nbsp;Any Windows monitoring tool that is typicallly used for performance tuning is unavailable </span></td>
</tr>
<tr>
<td><span style="font-family: arial,helvetica,sans-serif;">&nbsp;DMVs</span></td>
<td><span style="font-family: arial,helvetica,sans-serif;">&nbsp;Limited</span></td>
<td><span style="font-family: arial,helvetica,sans-serif;">&nbsp;A few dynamic management views(DMVs) are available and provide insightful information about running sessions and statements previously executed </span></td>
</tr>
<tr>
<td><span style="font-family: arial,helvetica,sans-serif;">&nbsp;Library metrics</span></td>
<td><span style="font-family: arial,helvetica,sans-serif;">&nbsp;Yes</span></td>
<td><span style="font-family: arial,helvetica,sans-serif;">&nbsp;ADO.net provides library-level statistics that offer additional insight to developers ,such as the processing time from the consumer standpoint and bytes transferred</span></td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: large;"><strong>Coding implications</strong></span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Because we have no access to the server-sise configuration settings of SQL Azure,such as disk configuration,memory allocation,CPU affinitization,and so forth,we need to place more emphasis on the quality of your SQL statements-and,now more than ever,our network traffic.Indeed,the number of network roundtrips our code generates and the number of packets returned have an impact on performance because the connection to SQL Azure is a far link and the communication is encrypted. Our performance-tuning exercise should include the following areas:</span></p>
<ul>
<li><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"><strong>Connections pooling</strong>. </span></li>
</ul>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Because establishing a new connection requires multiple network roundtrips by itself and can affect our applicaions's performance,we should ensure that our connections are pooled properly.In addition,SQL Azure will throttle us if we stablish too many connections.</span></p>
<ul>
<li><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"><strong>Packet count</strong> . </span></li>
</ul>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Because the time spent to return data is greater than we may be used to,we need to pay attention to SQL code that genereates too many packets.For example,'print' statements generate more network traffic than necessary and should be removed from our T-SQL if at all possible.</span></p>
<ul>
<li><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"><strong>Indexing</strong>.</span></li>
</ul>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">SQL Azure may throttle our connections if it detects that our statement is consuming too mny resources.As a result ,proper indexing becomes critical when tuning for performance.</span></p>
<ul>
<li><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"><strong>Database Design</strong>. </span></li>
</ul>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Of course,certain database designs are better than others for performance.A heavily normailzed design improves data quality,but a loosely normailzed database typically improves performance.Understanding this tradeoff is also important when we're developing in SQL Azure.</span></p>
<p>&nbsp;</p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Here I only give a brief introduction about the tools,methods,coding implications that can be used in SQL Azure. I will give more details in my next blogs..</span></p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
  </channel>
</rss>