Book Image

ASP.NET Site Performance Secrets

By : Mattijs Perdeck
Book Image

ASP.NET Site Performance Secrets

By: Mattijs Perdeck

Overview of this book

Do you think that only experts with a deep understanding of the inner workings of ASP.NET, SQL Server, and IIS can improve a website's performance? Think again – because this book tosses that notion out of the window. It will help you resolve every web developer's nightmare – a slow website – with angry managers looking over your shoulder, raging calls from advertisers and clients – the lot. You don't have the time or energy to gain a thorough and complete understanding of ASP.NET performance optimization – You just need your site to run faster! This book will show you how.This hands-on book shows how to dramatically improve the performance of your ASP.NET-based website straight away, without forcing you through a lot of theoretical learning. It teaches you practical, step-by-step techniques that you can use right away to make your site faster with just the right amount of theory you need to make sense of it all.Start reading today and you could have a faster website tomorrow.Unlike other performance-related books, here you'll first learn how to pinpoint the bottlenecks that hold back your site's performance, so you can initially focus your time and energy on those areas of your site where you can quickly make the biggest difference. It then shows you how to fix the bottlenecks you found with lots of working code samples and practical advice, and just the right amount of theoretical detail.The first chapter details techniques for diagnosing performance issues using Waterfall charts. Subsequent chapters then each focus on one individual aspect of your website, providing you with numerous real-life scenarios and performance-enhancing techniques for each of them. In the last chapter, you learn how to effectively load-test your environment in order to measure the change in performance of your site without having to update your production environment – whether it is a new release or simply a small change in the database.
Table of Contents (19 chapters)
ASP.NET Site Performance Secrets
Credits
About the Author
About the Reviewers
Preface

Assuring good performance


Before you start diagnosing and fixing performance issues, let's first have a quick look at how this fits in to the overall process of assuring good performance. This process consists of these parts:

  • Continuous monitoring

  • Setting performance goals

  • Iterative improvements

Let's go through each part of the process one-by-one.

Continuous monitoring

The performance of your website is affected by both the things you control, such as code changes, and the things you cannot control such as increases in the number of visitors or server problems. Because of this, it makes sense to monitor the performance of your site continuously. That way, you find out that the site is becoming too slow before your manager does.

At the end of this section, you'll find a list of monitoring services that will keep an eye on your site.

What do you mean by "site is becoming too slow"? Glad you asked.

Setting performance goals

When this books talks about performance, it ultimately talks about page load time that's what your visitors and potential customers experience.

It pays to have a clear understanding of how fast is fast enough. Spending time and effort on making your site faster is time and effort not spent on other improvements. There is little point in making your site faster if it is already fast enough.

Your manager, client, or marketing department may have ideas about what constitutes "fast enough". Alternatively, visit the page Website Response Times at http://www.useit.com/alertbox/response-times.html to gain inspiration for setting performance goals.

Ok, you've been monitoring your site, and found it is getting too slow. What now?

Iterative improvements

Because websites, web servers, and browsers are such complex beasts, it pays to make improvements in a deliberate fashion. Hence, these two golden rules:

  • One change at a time: Because multiple changes can affect each other in surprising ways, life will be much easier if you implement and evaluate changes one-by-one.

  • Test, test, test: You don't know whether your change really is an improvement until you have tested it thoroughly. Make sure that performance after the change is better than performance before the change, and be ready to roll back your changes if it isn't; what works for other sites may not work for your site.

This process makes your site run faster. An iterative process is shown as following:

  1. 1. Record the current performance.

  2. 2. Diagnose the performance problem identify the single most important bottleneck.

  3. 3. Fix that one bottleneck (remember, one change at a time).

  1. 4. Test your change. Has performance improved? If it didn't, roll back your change and come up with a better fix. If it did, go back to step 1.

As a result of this, making your site faster is an iterative process:

If you find bottlenecks that currently do not pose a problem, but will come back to bite you in the future, it may be good to fix them, now that they are clear in your head.

We can capture all this in a flowchart:

Monitoring services

If you search Google for "site monitoring service", you'll find lots of companies that will monitor your website's performance for you. They also alert you when the response time gets too high, indicating your site is down.

Here are a few of the monitoring services that offer a free plan at the time of this writing. Note that the descriptions below relate to the free plan. If you are prepared to spend a bit of money, check their websites for their offerings:

  • Pingdom:

    Pages you can monitor: 1

    Checking frequency: Once every 1, 5, 15, 30, or 60 minutes

    Checks from: United States, Asia, Europe

    Sends alerts via: E-mail, SMS, Twitter or iPhone

    Reporting: Detailed downloadable stats showing the result of each check

  • Mon.itor.us:

    Pages you can monitor: Unlimited (1 per contact e-mail address)

    Checking frequency: Once every 30 minutes

    Checks from: United States, Europe

    Sends alerts via: E-mail, SMS, Twitter, or IM

    Reporting: Weekly reports, real-time graph

  • dotcom-monitor:

    Free 30-day trial

    Pages you can monitor: Unlimited

    Checking frequency: Once per minute

    Checks from: United States, Europe, Israel

    Sends alerts via: E-mail, Phone, SMS, Pager, SNMP

    Reporting: Daily, weekly, and monthly e-mails, extensive online reports, and graphs

  • 247webmonitoring:

    Pages you can monitor: 5

    Checking frequency: Once every 15, 30, or 60 minutes

    Checks from: United States

    Sends alerts via: E-mail

    Reporting: Real-time graph

Now that we've seen the process of assuring satisfactory performance, let's focus on how to diagnose and fix performance problems. After all, that is what this book is all about.