Ramani Sandeep's Blog

DotNetting – Fast , Easy Way of Developing Applications

Archive for the ‘Performance’ Category

Common performance issues on ASP.NET web sites

Posted by Ramani Sandeep on February 2, 2011

I spend a lot of my time analysing the performance of web sites and tuning the applications to make the sites run more efficiently and scale better. Overtime I’ve pulled together a checklist of some of the more common performance issues that I see and how to resolve them, and I thought it was about time I shared them here.

Most of the issues I’ve identified are straightforward to fix (many are just configuration changes) and can give significant improvements to the scalability and the responsiveness of your web site. Some of them you may well already be aware of and I’m still amazed how many of the more obvious ones don’t get implemented as a matter of course, but then it keeps me in a job!

This post is broken down into three sections; the first is cold start improvements, or “why does my web site take so long to start up?”. This involves looking at what the IIS worker processes (w3wp.exe) are doing during initialisation, prior to completing the initial client request that caused them to launch.

The second section, which is generally more important, looks at the efficiency of processing requests once the server has “warmed up”, and is hopefully the state that the web site will spend most of its time in!

Finally the third section provides a general discussion around accessing SQL Server and web services from within web applications. These aren’t necessarily quick wins and may involve some changes to interfaces (or even the solutions architecture) to successfully implement, Finally, I’ll reveal the three golden rules for producing fast, scalable applications that I’ve derived from my investigations.

For each issue, I’ve included a brief description and references to where more information on the issue can be obtained and how to resolve it.

Read more…

Hope this will help !!!

Jay Ganesh

Posted in ASP.NET, Performance | Tagged: , , | 1 Comment »

SQL SERVER – Stored Procedure Optimization Tips – Best Practices

Posted by Ramani Sandeep on February 17, 2010

Today when i read blog of Pinal Dave talking about "Stored Procedure Optimization Tips", i have found some of the very useful tips that can help us to write the SP in a such a way that it can increase the performance of the application.

Key Points discussed in the articles are :

  1. Include SET NOCOUNT ON statement
  2. Use schema name with object name
  3. Do not use the prefix “sp_” in the stored procedure name
  4. Use IF EXISTS (SELECT 1) instead of (SELECT *)
  5. Try to avoid using SQL Server cursors whenever possible
  6. Keep the Transaction as short as possible
  7. Use TRY-Catch for error handling

You can read full article here

Hope this will help

Jay Ganesh

Posted in Performance, SQL Server | Tagged: , | Leave a Comment »

Writing Efficient SQL: Set-Based Speed Phreakery

Posted by Ramani Sandeep on February 8, 2010

SQL is a declarative language, designed to work with sets of data. However, it does support procedural, "row-by-row" constructs in the form of explicit cursors, loops and so on. The use of such constructs often offers the most intuitive route to the desired SQL solution, especially for those with backgrounds as application developers. Unfortunately, the performance of these solutions is often sub-optimal; sometimes very sub-optimal.

Some of the techniques used to achieve fast SQL code, and avoid row-by-row processing can, at first, seem somewhat obscure. This, in turn, raises questions over the maintainability of the code. However, in fact, there are really only a handful of these techniques that need to be dissected and understood in order to open a path towards fast, efficient SQL code. The intent of this article is to investigate a very common "running total" reporting problem, offer some fairly typical "procedural" SQL solutions, and then present much faster "set-based" solutions and dissect the techniques that they use.

The examples in this article are based on the classic "running total" problem, which formed the basis for Phil Factor’s first SQL Speed Phreak Competition. This challenge is not some far-fetched scenario that you will never encounter in reality, but a common reporting task, similar to a report that your boss may ask you to produce at any time.

In my experience, I’ve mostly found that the ease of producing the solution is inversely proportional to its performance and scalability. In other words, there is an easy solution and a fast solution, as well as many solutions in between. One may argue that for a report that runs once a month, clarity and maintainability are as important as speed, and there is some truth is this. However, bear in mind that while you can get away with a simple solution on a table with a few thousand rows, it won’t scale. As the number of rows grows so the performance will degrade, sometimes exponentially.

Furthermore, if you don’t know what’s possible in terms of performance, then you have no basis to judge the effectiveness of your solution. Once you’ve found the fastest solution possible then, if necessary, you can "back out" to a solution that is somewhat slower but more maintainable, in full knowledge of the size of the compromise you’ve made.

Read more

Shout it

Posted in Performance, SQL Server | Tagged: | Leave a Comment »

Best Practices for Speeding Up Your Web Site

Posted by Ramani Sandeep on January 30, 2010

The Exceptional Performance team has identified a number of best practices for making web pages fast. The list includes 34 best practices divided into 7 categories.

1) Content

  • Minimize HTTP Requests
  • Reduce DNS Lookups
  • Avoid Redirects
  • Make Ajax Cacheable
  • Post-load Components
  • Preload Components
  • Reduce the Number of DOM Elements
  • Split Components Across Domains
  • Minimize the Number of iframes

2) Server

  • Use a Content Delivery Network
  • Add an Expires or a Cache-Control Header
  • Gzip Components
  • Configure ETags
  • Flush the Buffer Early
  • Use GET for AJAX Requests

3) CSS

  • Put Stylesheets at the Top
  • Avoid CSS Expressions
  • Choose <link> over @import
  • Avoid Filters

4) Javascript

  • Put Scripts at the Bottom
  • Make JavaScript and CSS External
  • Minify JavaScript and CSS
  • Remove Duplicate Scripts
  • Minimize DOM Access
  • Develop Smart Event Handlers

5) Cookie

  • Reduce Cookie Size
  • Use Cookie-free Domains for Components

6) Images

  • Optimize Images
  • Optimize CSS Sprites
  • Don’t Scale Images in HTML
  • Make favicon.ico Small and Cacheable

7) Mobile

  • Keep Components under 25K
  • Pack Components into a Multipart Document

           Read more

Posted in ASP.NET, ASP.NET 3.5, ASP.NET 4.0, ASP.NET Ajax, Css, JavaScript, Performance | Tagged: , | Leave a Comment »

 
Follow

Get every new post delivered to your Inbox.

Join 37 other followers