Chapter 10 Achieving Optimum Performance with PowerDynamo
Let's say that the high-volume Web site "Hockey" has an average of one request every two seconds, 24 hours a day. Half the data being accessed changes at most once a day (statistics, player info, and so on), while the other half is constantly changing (game scores, penalties, and so on).
We should look at each area of the site to determine how to eliminate inefficient or unnecessary processing.
We'll look at four key areas to ensure that the Web site is operating as efficiently as possible:
If you use Windows NT, you can use the Performance Monitor to monitor your Web site's performance. For more information see "Using the Performance Monitor".
Any document that takes longer than two seconds to execute can slow down a system. Wherever possible, documents must be as specific as possible so queries can execute as quickly and take no longer than the time between requests to complete. Ideally, each request should receive 100% CPU time. If this goal is attained, requests are processed at maximum efficiency.
Performance degradation is also caused by putting multiple queries in one script. It is far more efficient to have many specific documents than to have fewer general documents. More specific documents allow you to take advantage of output caching.
By categorizing your documents and setting them up accordingly, you can eliminate much processing time. Categorizing automatically uses caching and scheduling to enhance performance. You can categorize each document into one of the following three categories:
There are several ways to control the way connections work within a Web site:
The first value you should set to increase performance is the connection timeout value. The default connection timeout value of 0 indicates that all connections remain in the connection pool. Because of the fluctuating traffic that the Hockey Web site receives, this is not what we are looking for. For the best performance, we will set the connection timeout value to 15, which holds a connection in the pool for 15 minutes after the last time it was active . The number of connections stored in the connection pool fluctuates with the Web site volume. This produces better performance than constantly creating new connections or keeping enough connections in the pool to always cover the peak times of volume.
At peak times, the Hockey Web site uses a maximum of 20 user connections. This does not slow down the overall performance of the Web site, so we can set the maximum number of user connections to 20.
Number of user connections
Caching document output and scheduling
documents can greatly reduce the required number of user connections
for your Web site.
During the slow times, there is a minimum of four user connections per definition being used at any one time. By setting the minimum number of User connections to four, we ensure that four connections will always remain in each connection pool ready for use.
The minimum and maximum connections for user connections applies per definition . The minimum and maximum number of connections for Dynamo connections is a total, since each Web site has only one Dynamo connection. For example, if there are two user connections defined in the connections folder of Sybase Central; ("sales_db" and "marketing_db"), setting a minimum number of user connections to four means that eight connections would be held in the connection pool, once created.
Our Hockey Web site requires a slightly smaller number of Dynamo connections than user connections. We'll set the maximum number of Dynamo connections to fifteen and the minimum number of Dynamo connections to five.
Finally, let's look at whether the Hockey Web site is using temporary or permanent connections within its scripts. We need to ensure that temporary user connections are used only in the appropriate instances. Scripts that use temporary user connections that are reused in day-to-day Web use should be changed to permanent user connections to minimize the processing required to create a new connection each time.
For more information on connections, see "Working with connections".
Copyright © 2001 Sybase, Inc. All rights reserved. |