Chapter 10 Achieving Optimum Performance with PowerDynamo


Scheduling your scripts

PowerDynamo allows you to schedule documents to be executed hourly, daily, weekly, monthly or yearly. Once a scheduled document executes, subsequent requests of that document can receive the output without requiring processing time or User connections. Scheduling documents can significantly cut processing time and the number of database calls.

If a document called sample.stm were scheduled to run once every hour, here's what would happen:

  1. sample.stm is moved to a new file called sample.sts.
  2. If you selected to pregenerate the output, sample.stm holds the generated output resulting from executing sample.sts. If you did not select to pregenerate the data, sample.stm remains empty until the first scheduled execution. In either case, the output is available as a static source file, which makes a cachedOutputTimeOut value in scheduled documents unnecessary.
  3. An entry is added to the schedule.ssc file in the system directory to let Dynamo know that a document had been scheduled to run at the specified time.
  4. Subsequent requests for sample.stm returns the data being held in sample.stm. No execution of the document is required as the data remains available for subsequent retrievals until the next scheduled execution. When the next execution occurs, sample.stm is updated with new output.

For data that does not need to be updated more than once an hour, scheduling documents for slow times or at regular intervals can greatly increase the performance of a Web site.

Steps To schedule a document:

  1. In Sybase Central, locate the script or template to schedule.

  2. Right-click on the script or template and select Schedule from the pop-up menu to start the Schedule wizard.

  3. Select the time interval from the drop-down list in the wizard.

  4. Enter a time, within the specified time interval, at which the document is to be generated.


For more information about scheduling documents, see "Scheduling actions".

Note  

Documents that take parameters
Do not schedule or assign a cacheOutputTimeOut value to documents that require users to enter parameters. This kind of document depends on the parameters provided by the users; therefore, you cannot cache output.

For information on writing cacheable documents, see "Writing cacheable documents".

Enhancing performance for non-cacheable documents

For documents that would benefit from being scheduled but require user input you might want to separate the script into multiple documents. Create one main document with as many side documents as required to meet the main document's requirements. For example, if a main document allowed the user the option of choosing between A, B, C, or D, you might create four separate documents for each one. If the user chose option A, the applicable document would be called (docA.stm) from the main document. Because the content of docA.stm does not require user input, you can schedule it or assign a cachedOutputTimeOut value so data is already available for users that select A from the main document.

For more information, see "Writing cacheable documents".

 


Copyright © 1999 Sybase, Inc. All rights reserved.