|
|
|
This chapter describes the tuning considerations that arise when you use Form Services to deploy an application over the Internet or other network environment. This chapter looks at the network and the resources on the application server. It includes the following sections:
Tuning the connection between Form Services and the database server is beyond the scope of this chapter.
The Form Services and Java client include several optimizations that fit broadly into the following categories:
The Java client is primarily responsible for rendering the application display. It has no embedded application logic. Once loaded, a Java client can display multiple Forms simultaneously. Using a generic Java client for all Forms applications requires fewer resources on the client when compared to having a customized Java client for each application.
The Java client is structured around many Java classes. These are grouped into functional subcomponents, such as displaying the splash screen, communicating with the network, and changing the look-and-feel. Functional subcomponents allow the Forms Developer and the Java Virtual Machine (JVM) to load functionality as it is 640" width="423">
First impressions are important, and a key criterion for any user is the time it takes to load an application. Startup time is regarded as overhead. It also sets an expectation of future performance. When a business uses thin-client technologies, the required additional overhead of loading client code may have a negative impact on users. Therefore, it is important to minimize load time wherever possible.
After requesting a Forms application, several steps must be completed before the application is ready for use:
An application developer has little influence on the time it takes to launch the JVM. However, the Java deployment model and the structure of the Form Developer Java client allow the developer to decide which Java classes to load and how. This, in turn, minimizes the load time required for Java classes.
The Java client requires a core set of classes for basic functionality (such as opening a window) and additional classes for specific display objects (such as LOV items). These classes must initially reside on the server, but the following techniques can be used to improve the time it takes to load these classes into the client's JVM:
Java provides the Java Archive (JAR) mechanism to create files that allow classes to be grouped together and then compressed (zipped) for efficient delivery across the network to the client. Once used on the client, the files are cached for future use.
Form Services provide the following pre-configured JAR files to support typical deployment scenarios:
To specify one or more JAR files for an applet, specify the ARCHIVE parameter in the <APPLET> tag of the referencing HTML file. For example:
<APPLET CODEBASE="http://www.server.com/webcode/" ARCHIVE="f60all.jar, icons.jar" CODE="oracle.forms..">
Both of the supported JVMs for Form Services (Oracle JInitiator and Oracle JDK) support the caching of JAR files. When the JVM references a class, it first checks the local client cache to see if the class exists in a pre-cached JAR file. If the class exists in cache, JVM checks the server to see if there is a more current version of the JAR file. If there isn't, the class is loaded from the local cache rather than from across the network.
Be sure that the cache is of proper size to maximize its effectiveness. Too small a cache size may cause valid JAR files to be overwritten, thereby requiring that another JAR file be downloaded when the application is run again. The default cache size is 20MB. This size should be compared with the size of the cache contents after successfully running the application.
JAR files are cached relative to the host from which they were loaded. This has implications in a load-balancing architecture where identical JAR files from different servers can fill the cache. By having JAR files in a central location and by having them referenced for each server in the load-balancing configuration, the developer can ensure that only one copy of each JAR file is maintained in the client's cache. A consequence of this technique is that certain classes within the JAR file must be signed to enable connections back to servers other than the one from which they were loaded. The Oracle-supplied JAR files already pre-sign the classes.
One downside of the JAR method is that all classes within a JAR file need to be loaded and validated by the JVM before execution continues. A useful feature of the JAR file is the ability to refer to other JAR files, thus limiting the number of classes stored within the given archive. The JVM is able to navigate to the required JAR files in the order required by the application.
The Oracle-supplied f60splash.jar file contains enough logic to initialize the client and display a welcoming splash screen. It also contains deferred references to files that are contained in the other JAR files, which are subsequently loaded on demand. In order to use deferred load on demand, the f60splash.jar file must be the first JAR file referenced in the HTML page.
The developer can design the application to maximize data stream compression by using message diff-ing, which sends along only the information that differs from one message to another. The following steps can be taken to reduce the differences between messages:
set_item_property(text_item1_id, FONT_WEIGHT, FONT_BOLD); set_item_property(text_item2_id, FONT_WEIGHT, FONT_BOLD); set_item_property(text_item3_id, FONT_WEIGHT, FONT_BOLD); set_item_property(button_item1_id, LABEL, 'Exit'); ...
RAISE ON ENTRY = YES
(Canvas only)
VISIBLE = NO
Set_Application_Property (MENU_BUFFERING, 'false');
The following techniques may further reduce the resources required to execute an application:
The Forms runtime diagnostics have been enhanced with the addition of Performance Collection Services. These provide you with information you can use to better understand and improve your application's runtime performance.
To activate Performance Collection Services, include `record=performance' in the command line argument (for runtime in a client/server environment), or as a part of `serverArgs' parameter in the HTML file (for web deployment).
For example, if running in the client/server mode, use:
ifrun60 module=.. userid=.. record=performance log=yourlogname
The results are written onto the file yourlogname. If the file name is not specified, a file with a unique filename is created. This name is in the format `perf_xxxx' where `xxxx' is the ProcessId of the runtime process running.
In the HTML file, this invocation will be:
<param name= "serverArgs" value = "module=.. userid=.. record=performance log=yourlogname">
The following events are collected by Performance Services:
The data collected by Performance Services is analyzed using PERL scripts, f60parse.pl, which are located in the <ORACE_HOME>\6iserver\forms60\perl\ directory.
To start the data collection, enter the following command:
perl f60parse.pl -input=infile -eventf='evfile' -outputf='ofile'
Where:
By default, the output appears in the following HTML files, which can be viewed in a browser:
File name | Description |
---|---|
index.html |
Summary of user action |
detailed1.html |
Detailed events |
detailed2.html |
Detailed event collection |
event.html |
Event definitions |
When specified, an XLS output file is created with the given name.
When you develop and deploy a Forms application, you may want to know what parts of the application can be optimized and what actions are taking time or resources. Oracle Trace integration allows you to analyze in depth the performance and the resource consumption of your Forms application.
Oracle Trace is part of Oracle Enterprise Manager (OEM). Oracle Trace is the Oracle tool to gather and analyze the performance of the Oracle Database, Form Services, and other products which implement the Oracle Trace API for tracing. To take full advantage of Oracle Trace, you must install Diagnostics Pack, one of the optional packs provided in the Oracle Enterprise Manager product suite. The Diagnostics Pack contains a set of tools to administer the Oracle Trace collections remotely through a GUI interface and to efficiently view the Oracle Trace output.
In this section, we discuss:
Oracle Trace only collects data for predefined events, of which there are two types:
Duration events have a begin point and an end point. For example, a transaction is a duration event. Nested events can occur in a duration event, such as if an error occurs within a transaction. Point events represent an instantaneous occurrence in the product. For example, the display of a canvas or a dialog are point events.
For Form Services, those events are defined in a binary file (oforms.fdf), shipped as part of Form Services and located in the following directory:
NT: <ORACLE_HOME>\6iserver\net80\admin\fdf
UNIX: <ORACLE_HOME>/6iserver/network/admin/fdf
The following table lists the Forms duration event number and name, describes the event and the specific and generic items associated with it. The items are the information displayed for this particular event.
Each point event also has a Timestamp. Duration events have a Start Timestamp and an End Timestamp.
The following table lists the Forms point event number and name, and describes the event and both specific and generic items associated with it.
Even if you have not installed Oracle Enterprise Manager and Oracle Diagnostics Pack, you can still use Oracle Trace to profile your Forms application. When you install Form Services, the command line trace executables are automatically installed in your <ORACLE_HOME> and provide a manual way to analyze your Forms application performance.
To use Forms and Oracle Trace without the Diagnostics Pack, you must:
Without the Oracle Diagnostics Pack installed, you need to use the Command Line Interface (CLI) to manage your data colections. The CLI is available from a MS/DOS window on Windows-based systems or from the console on Unix-based systems.
1. Start the collection with the otrccol command.
To start the data collection, enter the following command:
otrccol start job_id input_parameter_fileWhere:
Once you have started the collection, a process is running and waiting for a Forms application to run in trace mode.
2. Start your Forms in Trace mode
To start your form in Trace mode, you need to add the parameter pecs=trace to the command line.
ifrun60 module=myModule userid=scott/tiger@orcl pecs=traceInclude pecs=trace as part of the serverArgs parameter defined in the HTML file used for running the form. Include otherParams=pecs=trace as part of your specific section in the formsweb.cfg file.
Your application should now be running in trace mode, and all the events occurring during the execution of the aplication are written to two output files specified in the parameter file used to start the collection.
3. Locate the output
Once you have run your Forms application in trace mode, two files will have been generated:
Those files are located in the following directory:
NT: <ORACLE_HOME>\6iserver\otrace80\admin\cdf
Unix: <ORACLE_HOME>/6iserver/otrace/admin/cdf
4. Stop the collection with the otrccol command
To stop the data collection, enter the following command:
otrccol stop job_id input_parameter_file
where job_id and input_parameter_file are the same parameters as the ones used to start the collection.
Once you have generated the trace files, you are ready to fromat the output to view the information you have gathered diring the Forms session. When you don't have the Oracle Diagnostics Pack installed, you can produce text files from the trace files using the Oracle Trace statistics reporting utility.
The Oracle Trace statistics reporting utility displays statistics for all items associated with each occurrence of a server event. These reports can be quite large. You can control the report output by using command parameters. Use the following command and optional parameters to produce a report:
otrcrep [optional parameters] collection_name.cdf
Oracle Trace creates one text file per event and includes the entire set of items in that event. For example, one file for the triggers, one file for the built-ins, one file for the network, and so on.
You can manipulate the output of the Oracle Trace reporting utility by using the following optional report parameters:
If you have the Oracle Diagnostics Pack installed, you can take advantage of the tools provided to manage the Oracle Trace collections remotely with Oracle Trace Manager and view the collected data with the Trace Data Viewer.
To use Oracle Trace Manager, you first have to install Oracle Enterprise Manager on a middle tier machine and install the Intelligent agent on the nodes where you want to collect the data.
For more information about now to install OEM, please refer to the Oracle Enterprise Manager docmentation.
From the Oracle Trace Manager, you are able to:
Once you have started the collection on a node, you can see that the collection is running from the Oracle Trace Manager main screen, and you can stop it at any time remotely from the same tool. Once the Data Collection is running, you can run your Forms applications in trace mode.
The Trace output generated when using the Trace Manager is the same as when using Oracle Trace from the command line utilities. Only the way you start the collection differs. This means that after the application has been run in trace mode, the two trace files are generated (.CDF and .DAT files) in the CDF directory.
To be able to view the content of the trace with the Trace Data Viewer, the trace output needs to be formatted to a datagase schema. To do this using Oracle Trace Manager, right click on the collection you want to upload to the database and choose the format option. This will automatically format the trace to the database in the schema specified in th Trace Manager preferences.
The trace output is now stored in the database within a specific schema. To view and analyze the content of this trace, launce the Trace Data Viewer and connect to the database with the user name that uploaded the data.
From the Trace Data Viewer, you can analyze:
From the Trace Data Viewer main screen, you can drill down to specific information about Forms sessions. For instance, the Network Traffic Statistics contain the number of bytes and packets sent or received, the IP address connected, and the number of roundtrips during the session.
You can drill down to the level of detail you want, going from an overview to a drill-down analysis of specific events, such as: Server, Triggers, Builti-ins, Query, and other types of events. For each of these events, you have a detailed view of the time spent and the CPU consumption for the events. When you choose a detailed view, you can sort the information displayed by CPU consumption or time elapsed by clicking on the column header of the column you want to sort by. For instance, this is very helpful in determining which trigger takes the most time to execute or which built-in consumes the most CPU resouces.
Finally, Trace Data Viewer summarizes all the duration events and point events that occurred during the execution of each form with an average and standard deviation of CPU and elapsed time for all the duration events.
This section describes the format of Load Balancer Server trace messages. To start a trace, you must restart the Load Balancer Server and specify the <traceLevel> parameter in the forms60_server shell script. The <traceLevel> defaults to 0 for no tracing. Specifying 10 allows you to create trace output for the Laod Balance Server.
Trace level 1 contains a header as follows:
HOSTNAME: neko.us.oracle.com IP ADDRESS: 144.25.83.146 Data port number: 1234 Request port number: 1235 Maximum number of clients: 10 Trace level: 2
At Trace level 2, messages are given in the following format from a D2LC client. A description of each field follows.
D:000 144.25.83.92:1236 922541864 1 2 45 3 [cogito] | | | | | | | | | | ^ | | | | | | | | | Packet type recv'd ^^^ | | | | | | | | Client index ^^^^^^^^^^^^ | | | | | | | D2LC IP Address ^^^^ | | | | | | D2LC Port number ^^^^^^^^^ | | | | | Time msg recv'd ^ | | | | Scale factor ^ | | | Sequence number ^^ | | Number of processes ^ | Last selected ^ D2LC Hostname
The description of each field of the trace log is as follows:
The following is a sample trace file for a two server configuration. Formsvr1 runs a D2L client and D2L server. Formsvr2 runs a D2L client.
HOSTNAME: formsvr1.us.oracle.com IP ADDRESS: 144.25.87.101 Data port number: 1234 Request port number: 1235 Maximum number of clients: 10 Trace level: 2 D:000 144.25.87.101:1000 925260387 1 2 0 0 [formsvr1] D:000 144.25.87.101:1000 925260387 1 3 43 0 [formsvr1] D:001 144.25.87.102:1001 925260388 1 2 0 0 [formsvr2] D:001 144.25.87.102:1001 925260388 1 3 43 0 [formsvr2] S:000 144.25.87.101:1000 925260387 1 3 44 1 [formsvr1] D:000 144.25.87.101:1000 925260387 1 4 45 1 [formsvr1] D:001 144.25.87.102:1001 925260388 1 4 45 0 [formsvr2] S:001 144.25.87.102:1001 925260388 1 4 46 2 [formsvr2] D:000 144.25.87.101:1000 925260387 1 5 45 1 [formsvr1] D:001 144.25.87.102:1001 925260388 1 5 45 2 [formsvr2] S:000 144.25.87.101:1000 925260387 1 5 46 3 [formsvr1] D:000 144.25.87.101:1000 925260387 1 6 47 3 [formsvr1] D:001 144.25.87.102:1001 925260388 1 6 47 2 [formsvr2] S:001 144.25.87.102:1001 925260388 1 6 48 4 [formsvr2] D:000 144.25.87.101:1000 925260387 1 7 47 3 [formsvr1] D:001 144.25.87.102:1001 925260388 1 7 47 4 [formsvr2]
|
Copyright © 2000 Oracle Corporation. All Rights Reserved. |
|