For the last four or five years I have given a number of presentations on improving the performance of web applications, sometimes specifically focusing on DNN other times taking more broadly on ASP.NET. However, the most popular of all presentations that I have given on Web Application performance was a session that took a broad look at application performance not only from a server-side but also from a client-side application. This talk was actually tailored to users that came from many application development backgrounds. In this blog series, I will share the information that was contained in that talk as well as a few more items of consideration that I have learned along the way.
In this series, I will focus on providing a helpful diagnostic process, and the associated tools of the trade to help make each step of the process easier. The following will show what is planned to be included in each of these posts. As articles are added to the series, I will change these items to links for ease of use.
- Metrics! What Really Matters to You? - How to get started with performance optimizations.
- Users & Environment - Factor out problems before we start!
- Client-Side - Validate your Architecture - Making sure that your application is setting you up for success and identifying bottlenecks
- Server-Side - Finding those trouble spots, and the proper process to identify them.
At the end of the series, you should have a good understanding of how to go about reviewing your own applications and resolving performance issues that might be identified. Along the way feel free to share your own experiences in the comments!
Metrics! What Really Matters to You?
We are talking about Web Application Performance so why am I starting with metrics? The answer is quite simple, everyone evaluates the performance of applications under a different set of tooling. Identifying from the beginning the metrics that you want to put the most merit in is actually the most important thing to consider.
For example, some companies want to optimize the application for the best overall throughput, or the number of users served in a given amount of time. Others want to ensure that their application is scoring more than __ on the ____ test. (Insert the scores and name of your favorite test.) Others are looking for more generic and simplistic goals such as all pages under standard load situations must respond in less than 2 seconds.
What you determine here as the right metric is totally up to you. It is important to know these metrics and ensure that all of the work done down the road is continually validating your experiences against this given metric. This is the reason it is important to set this goal now, rather than to set this part way down the road. If you are set to optimize your site to handle 500 users at the same time, when performing all of the other tests and optimizations discussed in this series you need to ensure that the site is loaded with your desired load. As it isn't a valid test otherwise.
I cannot tell you here what is the right or wrong metric to optimize for. If you have no idea, going for the sub-2-second page load is a great way to start with your application and will help ensure that overall you are providing good user experience.
Tracking The Metric!
Now that you have identified the metric you want to improve, the most important part to do is take a baseline measurement. This involves taking your application and testing the current performance against your desired metric. If using a speed-based metric, ensure that you record the connection that you came from, the browser that you were using, and make not of anything else that might have impacted performance. The goal here is to be able, as accurately as possible, to re-test against this metric incrementally as you work on optimizing your application.
By testing, and re-testing against your metric of choice along the way you will be able to identify the things that help, and the things that hurt performance. For this reason, I cannot stress enough that this preliminary stage of evaluation is actually the most important portion of any performance optimization cycle. If you don't have metrics to show you where you came from and to validate where you landed in the end, how can you prove improvement?
Now that we know which metric we are shooing for, in the next post in this series we will discuss users & environmental issues that can either impact performance or impact the quality of our testing process. Working towards the final goal of improving your application performance.