Welcome to MSDN Blogs Sign in | Join | Help

SQL Server Reporting Services enables report developers to build and deploy reports quickly and without having to write complicated code. But this abstraction can come at a price. In general, most report developers either have no experience developing web applications or understand the behind the scenes mechanics of a web-based application like SSRS. Trouble-shooting slow loading web pages can be a frustrating experience for report developers if they don't have past experience dealing with web applications. Although it's relatively simple to see what SSRS is doing on the server side to process and render reports, tracking down problems on the client side can be difficult.

Let's start with a scenario where users are complaining that a particular report is taking a long time to display in the browser when the report URL is clicked in Report Manager. The report has no default values so it doesn't execute when opened. The users and management don't understand what's taking this report as long as 15-20 minutes just to open so it can be run.

I prefer to start with the base object in the SSRS hierarchy, the database. If the database isn't returning queries in a timely manner, nothing else is going to resolve the issue until the database is working properly. Since the report is not loading properly, we check the queries that populate the report parameters. There are several parameters that have a large number of possible values in this report. When we run the queries using Query Analyzer in Management Studio, the results are returned within a couple of seconds. This makes the issue with the report loading even murkier since SSRS should be able to run the parameter queries without a delay.

Since the problem with the report occurs before it is rendered, we can’t look at the execution log. At this point, the exasperated report development team manager might turn to the network support engineers for help. Their second response (after declaring that the network is performing just fine and dandy, thank you.) is to throw a network sniffer on the server’s network interfaces. They start trying to isolate and capture HTTP traffic to one of the client machines to see if they can trap the problem. But this can be a daunting task. Most network sniffers don’t make it easy to reassemble packets into holistic entities that the development team could correlate with what the report server is doing. After capturing several hundred megabytes of data, the network engineers throw in the towel and declare that it’s not their issue to resolve.

At this point, most report development teams might feel that all is hopeless and lost. Nothing in the database, the report server or the network appears to be causing the problem. Could it be the browser? That’s an obvious assumption given that the client machine is the only piece that hasn’t been declared fully functional. But how do you troubleshoot a browser problem on a client machine? The answer is to capture the network data on the client machine.

The best tool I’ve found yet is a utility named Fiddler. It is a useful tool that's used by web developers to trace IP traffic on the client. Fiddler is a web debugging proxy that logs and displays valuable information about what's going on between the browser and server. Fiddler is downloaded and installed on the client machine. When it is executed, it creates a local proxy that intercepts web traffic and displays metrics about response times, size and type of data and has viewers to display the actual data. Fiddler allows you to inspect all HTTP and HTTPS traffic, set breakpoints, and "fiddle" with incoming or outgoing data. Fiddler includes a powerful event-based scripting subsystem, and can be extended using any .NET language.

The Fiddler web site has plenty of information about setup, configuration and operation which I will not dig into in this article. There are also extensions for Fiddler. I installed one, neXtpert, which is a performance report generator. Although most of the functionality of neXpert is not needed for debugging SSRS, the annotation feature is helpful for denoting different phases of the test process.

Here’s a screen capture from Fiddler. It shows a archive of a capture in the left hand pane with yellow highlighting of a set of sessions that are related to a report being loaded. This will give you a frame of reference as we discuss the use of Fiddler in detail.

 Figure 1

Let’s get back to resolving our vexing report load problem. On the client machine, we open Fiddler. The tool creates a local proxy server that any application that connects to the web will use. This is an important point to remember for several reasons. First of all, Fiddler captures HTTP traffic from any application running on the machine. This includes email clients, web browsers, download managers, IM, social networking and even things like the Windows Sidebar (more on that later). Secondly, the application we want to test must use the Fiddler proxy. If the browser or application reads it’s web proxy settings from the Internet Options control panel and the “Automatically Detect Settings” option is checked there, you should not experience any problems. When the application sends out the WPAD request, it will find Fiddler and use it as it’s proxy server. If you are having problems capturing with Fiddler, this is a good starting point for troubleshooting.

As mentioned earlier, Fiddler captures traffic from any application on the client. There a couple of ways to fine tune what Fiddler captures. The quick and dirty way is to shut down everything on the machine except the browser. You’ll probably get most everything shut off but you might overlook something which may show up in your reports. I did this with Windows Sidebar. The report generated by the neXtpert extension included Sidebars use of cookies in one of the gadgets. The client who saw the report got a little freaked out that their internal server was accessing some external domain without their knowledge. Once I stopped laughing (not at them but at my ignorance) I explained to them the origin of the cookies and they understood what had happened. Point is, be careful about what your capturing. You can also configure Fiddler to restrict capture to a specific host and application. Filters can be set under the Filters tab in the right hand window. Note that there a lot of filter settings but most aren’t necessary for what we trying to accomplish. The last way to filter results is to use the highlight session feature to identify relevant sessions. This is useful if you forget to shut things down or filter. It can also be handy when you’re analyzing a saved capture.

When you’re ready to test, use Fiddler to clear the browser cache and then launch the browser. Navigate to the report server’s Report Manager home page. Find the problematic report in Report Manager. This is a good point to use neXtpert to annotate the test process. It will add a marker to the capture with your comments which will also show up in Fiddler’s generated timeline.

Click on the report’s URL and let the server and browser do their thing. When the report (finally) displays, annotate the completion in the neXtpert tab. Save the capture to a Fiddler archive from the File menu. If you’ve done a good job of filtering, you can save all sessions. If not, you can still highlight the sessions you want and save them.

At this point, with the whole report development team looking over your shoulder because they’ve never seen anything like Fiddler, it’s time to dig into the sessions and see what’s happening. In the web sessions window, let’s find the sequence of events that comprise the request for the URL to the server and what the server response may be. You may find it easier to view the data in Fiddler if you select the “Stacked Layout” option from the View menu.

Here’s a screen capture from Fiddler of an example session capture with some fields omitted for clarity.

Figure 2

These sessions show the browser opening the Report Manager and then locating the report and clicking on it’s URL. Since we’re troubleshooting a time lag opening a report, we want to pay close attention to what the server is sending down the wire. If we scan the Body column, we see fairly small amounts of data until we reach the last entry. the last request shows over 33mb of text/html data send from the server. That’s a big chunk of data for a browser to process. If we select these sessions and click on the Timeline tab, Fiddler displays a timeline of the session activity.

Fiddler Timeline 1

Since we think the last session entry might be the cause of our problem, we display the timeline without selecting it. The timeline indicates that these operations took less than 15 seconds total to be sent successfully to the browser.

Fiddler Timeline 2Here is the timeline with the last entry included (but truncated for clarity). It’s obvious that last glob of data is taking a long time to be delivered and rendered by the browser. But what is it? Why is the server sending that much data to the browser just to display a report and its parameters?

Using the Web View under the Inspectors tab gives us the answer. When we display the HTML, we see a rough rendering of the report. Our first realization is that the SSRS server had to send 33mb of data to the client just to display the initial report page. This can’t be good but we still don’t know what’s the root cause of the problem may be. To find out what’s in the HTML data, we use another inspector in Fiddler, the RAW view. Note that the default is to truncate the data at 150,000 characters. You can right-click the window and turn off the AutoTruncate feature. This will allow you to inspect all the HTML data. The first thing you will see is a large (in this case about 5mb) block of ViewState data. Since we can’t control this, we need to dig deeper. As we look further into the display we start to find a large number of HTML data that looks like this:

FiddlerCapture5 Examining the HTML, we see it is used to display checkboxes. Since we don’t have that many visible textboxes on the report page, they must be hidden or lurking in another report object. This particular report has a number of parameter dropdown lists. Could these be the root cause of the problem? Quite possibly. To reach this conclusion, you must understand what a browser must do to display what appears to be a simple object like a dropdown list. Dropdown lists are filled with values that can be selected. The values along with any HTML or Javascript required to format the list. In the screen capture above, you can see that there is a large ratio of data that wraps each value in the list. The question now is does this particular report have a problem with the amount of data in the dropdown lists. We know that there’s a large amount of data involved in this report. If we look at the live report, we can see there are a LOT of values in each dropdown. Earlier, we checked the queries to see how they performed. But what we didn’t pay attention to is how many rows of data were being returned. At this point, it’s pretty safe to assume that this is our problem. To confirm, we deploy another version of this report with the dropdown lists populated with only one value each. When we click on the report URL, it displays quickly.

So we’ve found the problem, how do we fix it? A detailed description is out of scope for this article, but here’s a couple of methods to minimize issues like this. One is to limit the total number of values displayed in dropdowns and other objects. Drilldowns and sub-reports are other techniques that can alleviate these issues.

Hopefully, this should give you some insight into troubleshooting Reporting Services at the client tier.

Fiddler is freeware and can debug traffic from virtually any application, including Internet Explorer, Mozilla Firefox, Opera, and thousands more. You can download Fiddler here.

In this episode, guest Paul Thurrott joins Dmitry and Peter to discuss Windows Server 2008 R2 and Virtualization. Also Peter and Dmitry discuss the news about Codeplex.org, an open source software foundation created by Microsoft.

The Connected Show Episode 16

 

Get Connected With the Connected Show Online

 

Follow us on Twitter, Become a Fan on Facebook

 

About the Connected Show 

 The Connected Show is a new podcast focused on the latest Microsoft developer technologies and interoperability with non-Microsoft technologies.  It is hosted by Dmitry Lyalin (Microsoft Consulting Services) and Peter Laudati (Developer Evangelist).  It’s a heterogeneous world out there.  Microsoft has a lot of great technology solutions and we want to let folks know that anyone can take advantage of them, even if they’re not regular Microsoft technology users. 

 

New episodes are published on a weekly basis.  Recently published episodes include:

 

·        Jon Skeet on C# 4.0 w/Jon Skeet

·        Zune HD w/Rob Greenlee

·        Sketchflow in Blend3 w/Christian Schormann

·        SQL Compact Edition w/Himradi Sarkar

·        JNBridge: Spanning Java & .NET w/Wayne Citrin

·        PRISM for Silverlight w/Shawn Wildermuth

·       Community Soup… Virtual Worlds w/Zain Naboulsi

 

If you can read one of the fifteen languages supported by the Windows Live Translator, you can now view this blog in one of those languages. Simply click on the dropdown at the top of this web page to select the language. A new browser window will open and display both the English and translated pages side-by-side. To get more information on the Windows Live Translator and how to use it with your web site, click here.

إذا كان يمكن قراءة إحدى لغات خمسة عشر تدعمها مترجم Windows Live يمكنك الآن عرض هذه المدونة بإحدى تلك اللغات. ببساطة انقر فوق القائمة المنسدلة في أعلى صفحة ويب هذه إلى تحديد اللغة.

如果您可以阅读的支持的 Windows Live 译者十五语言之一,您现在可以在这些语言之一中查看此博客。 只需单击下拉列表,选择语言此网页的顶部。

如果您可以閱讀的支援的 Win

dows Live 譯者十五語言之一,您現在可以在這些語言之一中查看此博客。 只需按一下下拉清單,選擇語言此網頁的頂部。

Als u een van de vijftien talen worden ondersteund door de Windows Live-NAT lezen kan, kunt u dit web log nu weer geven in een van deze talen. Klik op de vervolg keuze lijst boven aan deze pagina om de taal te selecteren.

Si vous pouvez lire une des quinze langues soutenus par le traducteur Windows Live, vous pouvez maintenant afficher ce blog dans une de ces langues. Cliquez simplement sur la liste déroulante en haut de cette page web pour sélectionner la langue.

Wenn Sie eine der von der Windows Live-Translator unterstützt 15 Sprachen lesen können, können Sie nun diesen Blog in diesen Sprachen anzeigen. Klicken Sie einfach auf der Dropdownliste oben auf der dieser Web-Seite, die Sprache auszuwählen.

אם באפשרותך לקרוא עשרה השפות הנתמכות על-ידי Windows Live מתרגם, כעת באפשרותך להציג זה בלוג באחת משפות אלה. פשוט לחץ על התיבה הנפתחת בחלק העליון של דף אינטרנט זה כדי לבחור את השפה.

Se è possibile leggere una delle quindici lingue supportate dal Windows Live Translator, è ora possibile visualizzare questo blog in uno di tali lingue. Basta cliccare sull'elenco a discesa nella parte superiore di questa pagina web per selezionare la lingua.

Windows Live Translator によってサポートされる、15 言語のいずれを読み取ることができる場合、それらの言語のいずれかでこのブログを今表示できます。 言語を選択するこの Web ページの上部にドロップダウン リストを [単します。

Windows Live 번역기 지원하는 15개 언어 읽기 이러한 언어 중 하나에서 이 블로그 이제 볼 수 있습니다. 단순히 언어를 선택하려면 이 웹 페이지 맨 드롭다운 클릭하십시오.

Jeśli możesz przeczytać jedną z piętnastu języki obsługiwane przez Translator Live Windows, można teraz wyświetlać ten blog w jednym z tych języków. Po prostu kliknij na listy rozwijanej w górnej części tej strony sieci web, aby wybrać język.

Se você pode ler uma das quinze línguas suportadas pelo Windows Live Translator, agora você pode exibir este blog em um desses idiomas. Simplesmente clique na lista suspensa na parte superior desta página da web para selecionar o idioma.

Если вы можете прочитать на одном из пятнадцати языков, поддерживаемых Windows Live переводчик, этот блог теперь можно просматривать в одном из этих языков. Просто щелкните раскрывающийся список в верхней части этой веб-страницы для выбора языка.

Si usted puede leer uno de los quince idiomas admitidos por el traductor de Windows Live, ahora puede ver este blog en uno de esos idiomas. Simplemente haga clic en el menú desplegable en la parte superior de esta página web para seleccionar el idioma.

As many of you know, Windows 7 RTM is now available to MSDN and Technet subscribers. I've had the bits for Ultimate for a little over two weeks now. I would like to share my personal upgrade experience with you.

First to get the new bits was my work laptop. This machine is a Lenovo T61p with an Intel T7500 Core Duo running at 2.20gHz and 4gb RAM. My previous operating system was Vista Enterprise x64. I deliberately waited to get Win 7 until the RTM version was released. Most of my co-workers had upgraded their machines to the beta and RC versions. But being a database guy, I spend more time working in SSMS and VSTS so my OS choice wasn't as important as having to reinstall all my database tools if I changed the OS.

I got the bits during my Madison training in Redmond. I was ready to upgrade and experience all the cool stuff that I'd seen everyone else running on their machines. After tweaking the registry to allow the upgrade from Enterprise to Ultimate, I started the process. The upgrade ran flawlessly. It took about two hours to complete. A good bit of that time was spent migrating my files and settings to the new OS. Once it was done, I didn't have to do anything to my machine except to personalize the themes and other new features of Win7.

Once I got home from Redmond, it was time to start upgrading the other computers in my household. First up was an HP Presario. This laptop is x64 compatible but was running Vista Ultimate 32 bit. This required a clean install of Windows 7. This process was also smooth and pain free. Install time was much shorter since it didn't have to migrate any files and settings. I had to reinstall Office and iTunes. I also had to reconfigure the Family Safety software. Windows 7 only has controls on usage hours. Family Safety is now part of Windows Live and is much improved. This also means it's available for any version of Windows, not just Ultimate and Premium. I think this is a great move by Microsoft. Family Safety is now web-based and includes contact management for children. You can administer it from the web including changing allowed/blocked web sites, view logs, restrict downloads, etc. All I had to do was associate my child's Windows Live ID with his laptop's user account and it worked. Since this was a "clean install", the existing user files are moved under the Windows.old directory. Once I copied them over to the new Users directory, everything worked fine.

 A note to parents: even if you have a good relationship with your children and trust them implicitly, I recommend installing and using the Family Safety software available as part of the Windows Live package. It integrates seamlessly with Internet Explorer and provides a great way to manage and know what your children are doing on the Internet. If you would like to check it out, the software can be downloaded here.

Next up was a Dell Inspiron laptop. This machine was also x64 compatible so it went through the same process as the Presario. The only glitch during the install process was a problem reading the DVD with the install bits. Note that installing 64 bit Windows requires booting from a CD or DVD disk (or USB drive if your system supports it) since you can't run a 64 bit setup executable on a 32 bit OS. The problem manifested itself when the install process got stuck while expanding files. There's a setup error log saved in the temporary install folder on the C: drive. Checking that file indicated that the install image (the WIM file) was corrupt. This was probably some problem with the laptop's DVD drive reading the disk. Re-burning the bits from a USB drive to a new DVD on the laptop solved the problem.

The next machine to be upgraded is an older Compaq laptop running with an AMD Spherion 3300+ processor. Some of the newer Spherion chips are x64 compatible but this one is not. It also only has 768mb of RAM. It originally ran Windows XP Home and was the source of a lot of complaints about performance. I had already upgraded it to Windows Vista Ultimate, reduced the video memory settings to 32mb and upgraded to the latest BIOS in preparation for the Windows 7 release. I was pleasantly surprised that it would run Vista with that amount of memory. But it worked even with the Aero interface partially enabled. The upgrade process was (once again) very smooth. I de-authorized the computer for iTunes as recommended in the compatibility checker and de-installed the anti-virus software before starting. Since the upgrade, I've had no complaints about performance. I also deleted the recovery partition on the disk drive. This partition contained Windows XP and would never be used again. This freed up 7gb of disk space. Disk Manager will allow you to delete the partition and extend the existing system one to use the newly available space.

A couple of global recommendations about upgrading to Windows 7:

  1. Upgrade the machine's BIOS to the most current available. Check the manufacturer's web site for a new version.
  2. Run Disk Cleanup to get rid of old upgrade files, temporary files and other bits on the machine. I also deleted all the old system restore points since they were not needed with a new OS.
  3. Although Windows Update did a great job of downloading and installing the latest drivers for all the machines I upgraded, it would be wise to stage the necessary drivers on the hard drive from your manufacturer's web site. This is especially true if you're moving from 32 to 64 bit.
  4. If your machine is 64 bit compatible, either x64 or AMD64, install the 64 bit version of Windows 7. The computer world is moving away from 32 bit. You'll find that the performance and memory usage is worth it.
  5. If you have problems re-installing an application because the install utility indicates that the OS isn't supported, try running it in Vista compatibility mode.
  6. When moving from 32 to 64 bit, make a list of what software is installed so you can easily re-install it after the upgrade. If you don't, look at the C:\Windows.old\Program Files directory for hints.
  7. There are a couple of ways to move user files around: the Windows Easy Transfer utility, backup/restore and copy from the Windows.old\Users directory. If you leave the user files for the Windows install to handle, make sure you create new accounts for the machine users and have them log in before you copy the files. This will insure they get put under the correct location under C:\Users.

I've still got two more machines to upgrade. One has an older hard drive that's short about 2gb of the minimum 12.5gb required by the Win7 installer. Another is a server which will be getting Windows Server 2008 R2 in the near future. But for now, my main user base is upgraded and appears satisfied with the new version of Windows.

I realize that everyone's experience may vary from mine. The wonderful world of Windows is a big and diverse one. But I think you'll find that the move to Windows 7 will be a rewarding and fulfilling experience.

These are links to material relevant to consolidating and upgrading SQL Server. 

SQL Server Consolidation on the 64-Bit Platform - Lessons Learned

Pre-deployment IO Best Practices

Six Failover Clustering Benefits Realized from Migrating to SQL Server 2008 - Top 10 Lists

Microsoft SQL Server 2000 Scalability Project-Server Consolidation

Planning for Consolidation with Microsoft SQL Server 2000

SQL Server Consolidation on the 32-Bit Platform using a Clustered Environment

SQL Server Consolidation on the 64-Bit Platform

Report to Congress on Server & Data Center Energy Efficiency (Public Law 109-431)

Windows Server 2008 Multi-Site Clustering                           

Microsoft Product Lifecycle Search

Dell Smart Energy Calculator

Planning for Energy Requirements with Dell Servers, Storage, and Networking

SQL Server 2005 Upgrade Technical Reference Guide

SQL Server 2008 Version and Edition Upgrades

The What, Why, and How of Master Data Management

Scale-out Querying with Analysis Services

Scale-Out Querying with Analysis Services Using SAN Snapshots

Reporting Services Scale-Out Architecture

Introducing the SQL Server 2008 Data Collector

Microsoft Operations Framework 4.0

Jimmy May and Denny Lee (along with a huge supporting cast) have published an excellent white paper on disk alignment best practices. This is a must-read document for DBAs, storage engineers and architects.

Disk Partition Alignment Best Practices for SQL Server

All the official Microsoft Team Blogs are now listed on BlogMS. These are blogs maintained by the product teams and contain tons of good information about what's going on with our products. Here's the link to BlogMS.

In case you're wondering why my blog isn't listed on the front page, I'm a consultant who works in the field. I'm not part of the product development teams so my blog isn't considered "official" in the same way these are. My blog is listed, it's just buried in the 171 Microsoft blogs that are SQL Server related.

An astute member of the SQL Server community has observed the presence of SPIDs with a negative number. These anti-SPIDS were noted in SQL Server 2000 and appear to be generated by MSDTC.

I'm wondering if they behave like anti-matter and cancel out positively numbered SPIDs when they meet in a scheduler?

Comments are welcome.

For more information, see Rob Kraft's blog.

 

Thanks to those of you who attended SQLSaturday and a special thanks to all the volunteers from the Atlanta.MDF user group who put on a great event!

Here is the presentation I did for the SQLSaturday event in Atlanta. Please feel free to download and review. Keep in mind that this is a high level slide deck that compressed a very broad topic to an hour long session.

One of my colleagues, Rob Carrol, has uncovered a way to use the Performance Dashboard Reports on SQL Server 2008. Here's a link to his blog post on the topic:

http://blogs.technet.com/rob/archive/2009/02/18/performance-dashboard-reports-for-sql-server-2008.aspx

As a consultant working in the field, I am part of a relatively small group of people who are customer-facing (with an emphasis on facing). I am one of the front-line employees who's job it is to assist our customers with implementing our products and solutions. Its both a challenging and rewarding job that I really enjoy.

Another part of my job that is not as visible to the public is working with Microsoft internally. As a consultant, I have many opportunities to interface with our product, support, sales and marketing teams. Microsoft has a reputation for hiring smart people. Based on the caliber of the people I've met at Microsoft, that statement is very true. I'm not sure how I fit in with that but I try my best to keep up with everyone.

One thing that's a common property of Microsofties is how interesting they can be. I can honestly say that I've never met a fellow Microsoft employee who didn't have some interesting facet of his life to share. 

One of my fellow Microsofties has devoted their time to sharing the lives and careers of our fellow Microsofties. Check out Ariel Meadow Stallings blog Microspotting. She profiles different employees. You'll find some interesting people there.

Mark Pohto, one of our Microsoft IT senior system engineer's, just published an excellent technical white paper SQL Server Consolidation at Microsoft on Technet. This paper describes how Microsoft approached the issue of consolidating thousands of SQL Server instances. It's good guidance for how you can save money by consolidating your SQL Server infrastructure. 

Here's the link: http://technet.microsoft.com/en-us/library/dd557540.aspx

SQL Saturdays are events organized by local SQL user groups (mostly) that consist of a one day training event for SQL Server professionals. I've volunteered to speak at the SQL Saturday event in Atlanta. It's being hosted by the good people at Atlanta.MDF. If you're in the Atlanta region on Saturday, April 25th and want to spend a day hearing some top-notch speakers (and even me), then register for SQL Saturday at http://www.sqlsaturday.com/eventhome.aspx?eventid=17. Cost is only $10 for lunch. My presentation will be on SQL Server Consolidation and how you can apply a methodology to determine what servers in your database infrastructure can be consolidated and save both hard and soft costs.

If you aren't local to the Atlanta region, check out the home page of SQL Saturday at http://www.sqlsaturday.com and see when an event will be held in your area. If there's not one near you, get together with your peers and host your own SQL Saturday!

A new security patch for SQL Server has been announced. You should pay close attention to this one since it may not be immediately obvious that you have a server that requires this patch. The system I'm working on currently has SQL Server 2005 with Service Pack 3 (okay there) and SQL Server 2008 (also okay). But I almost missed the Windows Server 2008 Internal Database (not okay).

Moral of this post, make sure you scan security advisories carefully. Have your server administrators put a second or third pair of eyeballs on it. Then nothing slips through the cracks.

Here's the URL for the advisory: MS09-004

Here's another version of the reindex script that supports SQL Server 2005/2008 Standard and Workgroup Editions. It's got the online re-indexing code stripped out. If you're running something else like Workgroup, just change the code that checks for "Standard".

You can download the file attachment to get the script.

 

More Posts Next page »
 
Page view tracker