Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
ASP.NET Site Performance Secrets
ASP.NET Site Performance Secrets

ASP.NET Site Performance Secrets: Simple and proven techniques to quickly speed up your ASP.NET website

Arrow left icon
Profile Icon Mattijs Perdeck
Arrow right icon
Mex$179.99 Mex$1082.99
Full star icon Full star icon Full star icon Full star icon Full star icon 5 (6 Ratings)
eBook Oct 2010 456 pages 1st Edition
eBook
Mex$179.99 Mex$1082.99
Paperback
Mex$1353.99
Subscription
Free Trial
Arrow left icon
Profile Icon Mattijs Perdeck
Arrow right icon
Mex$179.99 Mex$1082.99
Full star icon Full star icon Full star icon Full star icon Full star icon 5 (6 Ratings)
eBook Oct 2010 456 pages 1st Edition
eBook
Mex$179.99 Mex$1082.99
Paperback
Mex$1353.99
Subscription
Free Trial
eBook
Mex$179.99 Mex$1082.99
Paperback
Mex$1353.99
Subscription
Free Trial

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

ASP.NET Site Performance Secrets

Chapter 2. Reducing Time to First Byte

The "time to first byte" is the time it takes your server to generate a page, plus the time taken to move the first byte over the Internet to the browser. Reducing that time is important for visitor retention you want to give them something to look at, and provide confidence that they'll have the page in their browser soon.

Reducing time to first byte involves making better use of system resources such as memory and CPU. An added benefit of a more efficient code is that there will be less need to buy more hardware when traffic grows.

This chapter consists of two parts, as explained.

The first section Pinpointing bottlenecks shows how to pinpoint a number of common bottlenecks, including:

  • Memory pressures

  • Caching

  • CPU usage

  • Thread usage

  • Long wait times for external resources

You will see how to use system counters to get a better understanding of what is going on inside your code. This will help you prioritize the most promising areas, so that you use your time...

Pinpointing bottlenecks


Before diving in and making changes to your website, it makes sense to first identify the most significant bottlenecks. That helps you prioritize areas to fix, so that you make the best use of your time.

Memory

First check whether the server is running out of memory. If it does, that will increase CPU usage and disk I/O (input/output), meaning that solving memory pressures will automatically reduce pressures on the CPU and Disk as well.

Shortage of memory increases CPU usage and disk I/O because when the server runs out of memory, it makes room by swapping pages of less-used data in memory to a swap file on disk, named pagefile.sys. Now when that data is needed again, and the server can't find it in memory, it causes a hard page fault, meaning that the server has to retrieve the data from the disk. All this takes much more CPU usage and disk I/O than a simple memory access.

The tool to use to see how much page swapping is going on depends on your operating system.

Windows...

Additional measures


Here are a few more ways to reduce the load on your server.

Deployment

The way you deploy your site to production can impact its performance. This section looks at making sure your code runs in the release mode rather than debug mode, and at reducing the number of assemblies making up your site.

Building projects in release mode

If your site is a web-application project rather than a website, or if your website is a part of a solution containing other projects, be sure to build your releases in the release mode. This removes debugging overhead from your code, so it uses less CPU and memory.

For building projects in release mode, follow these steps:

  1. 1. In Visual Studio, choose Build | Configuration Manager.

  2. 2. In the Active Solution Configuration drop-down, select Release and click on Close. The next builds will now be in release mode.

  3. 3. If you have a website in your solution, you'll see that it remains in the debug mode. This is because its compile mode is set by the debug...

Find out more


Here are more online resources:

Summary


This chapter showed how to pinpoint bottlenecks that slow down the generation of a web page. We discussed memory pressures, caching, CPU usage, thread usage, and long wait times for external resources. For each bottleneck, you were referred to the chapter that shows how to fix it.

We also had a look at some miscellaneous ways to speed up the generation of a web page, including making sure that your code runs in release mode, reducing round trips to the server and reducing unwanted traffic.

In the next chapter, we'll find out how to reduce your application's memory usage.

Left arrow icon Right arrow icon

Key benefits

  • Speed up your ASP.NET website by identifying performance bottlenecks that hold back your site's performance and fixing them
  • Tips and tricks for writing faster code and pinpointing those areas in the code that matter most, thus saving time and energy
  • Drastically reduce page load times
  • Configure and improve compression – the single most important way to improve your site's performance
  • Written in a simple problem-solving manner – with a practical hands-on approach and just the right amount of theory you need to make sense of it all

Description

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.

Who is this book for?

This book is written for ASP.NET/SQL Server-based website developers who want to speed up their site using simple, proven tactics without going through a lot of unnecessary theoretical learning. If your website isn't performing well, this is the ideal book for you.

What you will learn

  • Learn how to pinpoint and fix bottlenecks relating to all aspects of your site – server side, client side, code, images, and database.
  • Ensure shorter wait times for your site.
  • Eliminate the need to hire a DBA, by speeding up database access using insight into index structures and other advanced techniques.
  • Drastically speed up image loading, by exploiting browser behavior and by removing the hidden overhead in each image file.
  • Use ASP.NET s caching feature to dramatically improve performance by adding just a few lines of code.
  • Prevent a little known bottleneck overlooked by most developers – a shortage of worker threads in IIS – by using asynchronous methods.
  • Enable compression in IIS 6 and IIS 7 to cut file transfer times and bandwidth costs.
  • Reduce your Memory and CPU usage.
  • Optimize the deployment and usage of forms on your website.
  • Speed up JavaScript and CSS loading.
  • Diagnose problems as they occur, using waterfall charts.
  • Load-test your environment to measure the level of improvement in performance.
  • Find heaps of reference links and descriptions of free and low cost tools and services that make it easy to spot performance issues right away.

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Oct 13, 2010
Length: 456 pages
Edition : 1st
Language : English
ISBN-13 : 9781849690690
Vendor :
Microsoft
Category :
Languages :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Oct 13, 2010
Length: 456 pages
Edition : 1st
Language : English
ISBN-13 : 9781849690690
Vendor :
Microsoft
Category :
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just Mex$85 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just Mex$85 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total Mex$ 2,707.98
Microsoft SQL Server 2012 Performance Tuning Cookbook
Mex$1353.99
ASP.NET Site Performance Secrets
Mex$1353.99
Total Mex$ 2,707.98 Stars icon
Banner background image

Table of Contents

14 Chapters
High Level Diagnosis Chevron down icon Chevron up icon
Reducing Time to First Byte Chevron down icon Chevron up icon
Memory Chevron down icon Chevron up icon
CPU Chevron down icon Chevron up icon
Caching Chevron down icon Chevron up icon
Thread Usage Chevron down icon Chevron up icon
Reducing Long Wait Times Chevron down icon Chevron up icon
Speeding up Database Access Chevron down icon Chevron up icon
Reducing Time to Last Byte Chevron down icon Chevron up icon
Compression Chevron down icon Chevron up icon
Optimizing Forms Chevron down icon Chevron up icon
Reducing Image Load Times Chevron down icon Chevron up icon
Improving JavaScript Loading Chevron down icon Chevron up icon
Load Testing Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Full star icon 5
(6 Ratings)
5 star 100%
4 star 0%
3 star 0%
2 star 0%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




Goodstuff Appreciator Oct 01, 2011
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Term "ASP.NET performance" returns more than 60,000 results on Google search. If you need to learn how to develop fast ASP.NET websites, it's easy to get lost in the ocean of articles, instructions, and blogs. ASP.NET Performance Secrets makes this task much easier.The book is not just a collection of tips and secrets; it rather describes a systematic approach to optimizing websites. Book content is a workflow of the optimization process. It lists the areas that performance-minded developers need to bear in mind to improve speed of webpages.It starts from diagnostic, then goes into areas such as optimizing memory, CPU, caching, and reducing time to first and last byte, and then covers more advanced topics such as threading and load testing. It also describes techniques helpful to keep any websites fast (not only ASP.net) such as optimizing javascript, images, database and compression.While beginners may want to read the entire book as a practical guide, it also can be used as a reference book. It is well organized and every chapter can be read independently. I keep this book handy and return to the chapters that I need for particular projects.
Amazon Verified review Amazon
Joseph Guadagno Mar 25, 2011
Full star icon Full star icon Full star icon Full star icon Full star icon 5
When I first got this book I thought it was going to be a compilation of tips and tricks. I was quite surprised with the fact that it really wasn't. The author starts out by telling you how you to determine the bottlenecks in your site then goes into a lot of samples on how to correct and / or improve them. He covers memory, CPU, caching, compression and more.This book is definitely worth a read then a reread every once in a while. I plan on implementing some of the suggestions for my sites.
Amazon Verified review Amazon
Gomolickij Dec 08, 2022
Full star icon Full star icon Full star icon Full star icon Full star icon 5
As described.
Amazon Verified review Amazon
Joe Stagner Feb 03, 2011
Full star icon Full star icon Full star icon Full star icon Full star icon 5
There are few ASP.NET Performance books out there and even fewer good ones.This one I like. Matt Perdick has taken an interesting approach by not just presenting technology tips and tricks that can be used to positively effect performance but rather presents the technologies in the context of a methodology one can use to identify and resolve performance problems in their own web applications.Matt covers the tools you can use with the bottleneck pinpointing process to find and fix issues with :*Time to First Byte*Memory Usage*CPU Consumption*Caching*Browser*Proxy*Output*IIS Output*Data*Thread usage and Asynchronous Architectures*Reducing Long Wait Times*Database Access*Time to Last Byte*Compression*Forms Optimization*JavaScript and CSS*Images*Load TestingIt's easy to read with ample code samples and screenshots and contains many, many of the kind of tips you would expect concerning things like ASP.NET View State, Element Ids, working with User Agent specifics, etc.A good addition to your ASP.NET Expertise.
Amazon Verified review Amazon
Wayne O Aug 03, 2011
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Many of the SQL tuning tips apply to any sort of application that runs on SQL Server. What's more the author makes it easy for regular software developers to understand especially in regards to index creation.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.