Managing Applications with the MTS Explorer
The MTS Explorer interface simplifies creating and administering MTS packages and applications. You can add packages to an MTS application in two ways. You can use the package Wizard to create an empty package from within the MTS Explorer and then add components, or you can install a prebuilt package. To create an empty package, right-click Packages Installed in the MTS Scope Pane and select New, Package from the context menu, as Screen 1 shows. The Package Wizard will start and let you install a prebuilt package or create an empty one. Select Create an empty package, which Screen 2 shows.
The Package Wizard steps through naming a package and choosing the account the package will run under. The package can run under the account of the currently logged-on user or a specific user whose username and password you supply.
To add ActiveX DLLs to the package, double-click the new package, double-click the Components folder, and drag the DLL from Windows Explorer to the right pane of the MTS Explorer. MTS will register all the objects and display an icon for each component. Screen 3 shows the MTS Explorer with the Bank Client sample components installed.
You can right-click a component to display a property sheet for configuration. Options on the Transaction tab determine how the component will support transactions. The options are Requires a transaction, Requires a new transaction, Supports transactions, and Does not support transactions. If the component does not include MTS-specific code, choose Does not support transactions.
Declarative security is based on roles. A role is a logical group of users that can invoke interfaces on a component. For example, you can create a role named Clerk for an accounting package. Instead of giving members of that role full control over the application components, you can configure the role to have read-only access. Based on the NT accounts database and security, MTS objects can offer functionality to users based on their role. You add existing NT users and groups to a role to define membership.
To create a new role, select a package in the Scope Pane, and right-click the Roles folder. Select New, Role from the context menu that appears. To add users to a role, select the Roles folder, and select the applicable role. Right-click the Users folder. Select New, User and use the Add Users and Groups to Role dialog box.
The Security tab lets you enable security for the component. To choose which roles can access the component, right-click the Role Membership folder for the component. Next, select New, Role and select the role that will have access rights to the component.
Your component is now an MTS component. Using MTS Explorer's Status View, you can monitor the state of an application. Status View lets you quickly see the state of packages, processes, and computers.
Different types of objects have different Status Views. For example, Status View for components in a package lets you see the component's identifier, objects in call, and which objects have been activated. Status View for the Packages Installed folder can tell you which package is running. Status View for the Computers folder can tell you whether Microsoft distributed transaction coordinator (DTC) has been started.
To use MTS Status View, from the right pane of the MTS Explorer, double-click the icon of the package you want to monitor. Double-click the Components folder. On the View menu, select View, Status View. You can now see which components have been activated. Status View provides this information graphically (animated icons show you which components have been activated) and numerically. For example, in Screen 4, the Account, GetReceipt, MoveMoney, and UpdateReceipt components are active.
Transaction Statistics is another useful window. To open this window, click Transaction Statistics in the left pane, under the name of the computer you are managing. The Transaction Statistics window, shown in Screen 5, provides information about currently active components, all components that have been active, aggregate information on component response times, and when DTC was started.
Other Tools for Monitoring MTS Applications
Several other tools available to systems administrators make monitoring MTS applications easy. The first tool we will look at is Performance Monitor.
Performance Monitor shows you what is happening with MTS, the application, and server resources. Performance Monitor provides graphical statistics that you can use to measure your computer's performance. With Performance Monitor, you can measure resources in use or used over time. (For more general information about Performance Monitor, see Michael D. Reilly, "The Windows NT Performance Monitor," March 1997.)
Let's consider a sample application included with MTS. The Bank Client application lets you test MTS installations with SQL Server and shows you how MTS handles package deployment and administration. With the SQL Server Performance Monitor, you can quickly see the difference that MTS makes with respect to the number of database connections that an application uses.
We compared the Bank Client Application with the VisData sample application included with Visual Basic (VB) 5.0. Both sample applications accessed SQL Server; therefore, we used the SQL Performance Monitor with both.
We started five instances of the VisData application and observed the results in the SQL Performance Monitor. As Screen 6, page 171 shows, each of the five instances of the application requires a separate database connection. (At the bottom of the graph, you can see that the number of database connections in use increases from a minimum of seven to a maximum of twelve.) In addition, the application holds each database connection, consuming valuable resources, until you shut down the application.
Next, we started five instances of the Bank Client application. In Screen 7, SQL Performance Monitor informs us that the number of database connections in use increases from seven to nine. In other words, all five instances of our application accessed the SQL Server database but required only two database connections. MTS recycles connections among the instances of the application, but each instance believes that it has a persistent connection to the database. Furthermore, MTS reclaims those database connections when you no longer need them. If an instance of an application must access the database again, MTS will provide an existing connection from the database connection pool. This example demonstrates MTS JIT activation and ASAP deactivation.
The Network Monitor utility captures and displays network traffic. With Network Monitor, you can determine the effects that various component deployment arrangements have on network throughput.
Event Viewer is useful when your server application is failing or causing unexpected behavior. If you suspect that MTS is causing a problem on your server, check the Application log in the Event Viewer and examine the event messages. If MTS is the source of the error, you will see it listed in the Source column.
You can use User Manager for Domains to create and manage user accounts and groups and manage security policies. Use those users and groups and MTS roles to implement MTS security.
The Windows NT Diagnostics tool provides valuable information that is difficult to obtain otherwise. For example, you can click the Services tab to determine whether the services that MTS needs, such as SQL Server and DTC, are running.
The Memory tab can tell you about your server's memory utilization, thread usage, and active processes. You can also find information about your virtual memory paging file. At a glance, you know how much of your paging file is in use and the peak usage size. If either the current usage or the peak usage approaches the size of the file, you might need to increase the paging file size. You can resize the paging file from the Performance tab of the System applet in Control Panel.
MTS Applications and Network Performance
The tools we've mentioned provide valuable information that can help you increase system performance in many different areas. Now let's look at specific ways to increase performance in an area of particular concern: network performance.
Network performance is important to distributed applications, such as those MTS manages, because network performance often affects the user's perception of the application. If the network is performing poorly, users might perceive the application as performing poorly and unreliably. If the network is quick and responsive, the likelihood increases that users will perceive the application as quick, responsive, and reliable. Network performance is crucial to the overall performance of the application.
When you've collected information about your system and have found a bottleneck, you must determine how you will eliminate the problem. Always make only one change at a time, or you won't be able to determine which change affected the system.
One of the best ways to improve network performance is to reduce network traffic. You can migrate applications to lower bandwidth Internet/intranet protocols, such as HTTP, or localize servers inside departmental subnetworks. Migrating applications to Internet/intranet protocols works particularly well because you can use components installed into MTS in either standard client/server applications or HTTP-based applications.
You can also split your network into several subnetworks. If you increase the number of subnets and subsequently limit computers that frequently talk to one another to one subnet, you free bandwidth on the remaining subnets. This method is analogous to building additional roads to relieve traffic congestion.
Another effective but expensive option is to raise the speed limit of your network. You can upgrade your data link equipment to increase network speed. Upgrading your entire network is a major architectural change that you will probably do over time. To start, you can upgrade the backbone technology, the links between servers or certain subnetworks or users, to higher speed networks.
From Single Use to Multiuse with MTS
MTS provides a powerful environment for scaling single-use ActiveX components to multiuse components. In addition, NT offers several tools for monitoring MTS applications to ensure that all systems are running correctly. MTS lets software developers take advantage of the PC's convenience and flexibility to write enterprise applications. MTS offers systems administrators the piece of mind to know that those applications will run as reliably as mainframe applications.