Adding Reliability

Chapter 1

Chapter 2

It might not seem obvious, but whenever your system is stressed — lacking resources to accomplish a given task — it also becomes less reliable. Just how unreliable your system becomes depends on the kind, duration, and intensity of the stress. For example, your system will freeze completely when you run out of memory and there’s no recovery for the problem. Windows will usually try to warn you about the problem, but many users are so used to simply clicking OK for all message boxes that the system crash becomes inevitable.

Stress need not be as severe as complete loss of memory to cause problems, however. For example, try defragmenting your hard drive when the free hard drive space is less that 10 percent and you’ll find it takes a long time to complete (if it ever does complete). The problem is a lack of hard disk resources. Even though your hard drive has 10 percent free memory, the disk defragmenter might not have enough space to move large data segments around and will spend its time thrashing (a condition where an application tries to find enough hard drive space to perform a task to no avail).

Sometimes reliability problems occur even when the system seems to have enough resources, but you haven’t optimized it. For example, some applications begin to act oddly when they can’t request large enough pieces of memory, even though enough memory is available to answer the request. Windows memory can fragment over time and running too many applications at once only makes the problem worse.

The bottom line is that optimizing your system can make applications more reliable. Of course, there are various kinds of reliability, and you’ll want to ensure your optimized system provides them all:

* The application starts without displaying weird resource messages.

* The application runs without crashing (even gracefully).

* User settings are tracked properly and changes accepted as anticipated.

* All data remains accessible and intact.

* Data updates always occur as anticipated.

* None of the other running applications experience problems after starting a new application.

The problem of stress is so significant that many vendors provide a stress-testing tool as part of their development product packages. The stress-testing tool lets the developer set up memory, processor, and hard drive conditions that mimic various environments so the developer can see how the application reacts to the stress. Some of these tools even appear as part of the Windows Resource Kits. For example, the CPU Stress tool found in the Windows 2000 Resource Kit lets you create an application that uses a specific amount of processing power so you can see the effects on your application. Figure 2.4 shows how this application looks.

You can tell the application to perform multiple tasks (threads of execution), set the activity level of each thread, and give each thread a priority (Windows handles the needs of higher priority threads first). Although this tool might not look like much, it can help you judge just how stressed your system is now and how much additional stress it will suffer when running certain kinds of applications.

TIP Microsoft has a habit of making tools obsolete when it no longer feels like supporting them. The tool works fine, but Microsoft removes it from its Web site. You can often find these tools on other Web sites.

In most cases, the download should be safe, but always check the download to ensure it’s the tool and not a virus in disguise. A number of Web sites keep track of the various Windows tools. One of the more interesting is the Information on NT Tools site at http://www-rtsl.cs.uiuc.edu/tools/. This site contains a complete list of the various tools in the Windows NT Resource Kit, including the stress testing tools. Some third party products, such as BCM Diagnostics Pro (http://www.bcmdiagnostics.com/) also provide stress testing, so you might want to use this alternative when you have a lot of stress testing to perform.

Chapter 8 discusses many of the tasks you can perform to keep your system running well, making it consistently reliable. For example, defragmenting your hard drive regularly will help maintain the reliability improvements you see after you initially optimize your system. Make sure you enhance your own reliability and efficiency by automating the process as much as possible using the tips and techniques found in Chapter 11.

FIGURE 2.4 Create a processor stressed environment for testing applications using the CPU Stress tool.

back