Oracle® Application Server Forms Services Deployment Guide
10g Release 2 (10.1.2) B14032-02 |
|
Previous |
Next |
This chapter contains the following sections:
Tuning the connection between Oracle Application Server Forms Services and the Oracle Database Server is beyond the scope of this chapter.
The Oracle Application Server Forms Services and Java client include several optimizations that fit broadly into the following categories:
Section 10.1.5, "Minimizing Forms Services Resource Requirements"
Section 10.1.7, "Maximizing the Efficiency of Packets Sent Over the Network"
Section 10.1.8, "Rendering Application Displays Efficiently on the Client"
Use Oracle Enterprise Manager 10g Application Server Control Console to monitor Oracle Application Server Forms Services and review metrics information, including:
Forms Services Instances
Events
User Sessions
Forms Trace
Use the Overview page to monitor metrics for a Forms Services instance.
Start Enterprise Manager Application Server Control Console.
From the Enterprise Manager Application Server Control Console main page, select the link to the Forms Services instance that you want to monitor.
The Overview page for the Forms Services instance displays the following: Current Forms Services instance status (up, down)
URL of the Forms Services instance being monitored
Oracle Home of the Forms Services instance being monitored
Percent CPU usage for all forms runtime processes for this instance of Forms Services
Percent memory usage for all forms runtime processes for this instance of Forms Services
Number of users logged in
Response time is the ping time from Forms Enterprise Management agent to the forms servlet when the Enterprise Manager page is loaded.
Additionally, you can jump to the following detail pages: [[[to be linked]]]
Session Details
Forms Services Configuration
Environment
Forms Trace Configuration
Forms Utility
Use the Enterprise Manager Application Server Control Console to enable tracing for all events or specific ones.
Start the Enterprise Manager Application Server Control Console.
From the Enterprise Manager Application Server Control Console main page, select the link to the Forms Services instance that you want to monitor.
From the Overview page for the Forms Services instance, select the User Sessions link.
This page shows the following information about each user session for the Forms Services instance:
PID: The process ID of the user session.
CPU usage: The percent CPU used by the runtime process.
Memory usage: The percent memory used by the runtime process.
Client IP Address: The IP address of the client computer used to connect to Forms Services.
Database User Name: The database username used by the Forms application for the user session.
Time of connection: The time when the user connected to Forms Services.
Trace Status: Indicates if tracing is ON or OFF.
View Trace Log: Allows a user to view the trace log.
Configuration Section: Opens the Edit Section page for the configuration section used by a particular forms session.
Forms Runtime Pooling enables the startup of a configurable number of application runtime engines prior to their usage. Runtime Pooling provides quick connections at server peak times, which shortens the server-side application startup time. Runtime pooling is useful for situataions where server configurations have a small window in which many users connect to a Forms application. All prestarted runtime engines run in the same environment serving the same application.
Use Enterprise Manager Application Server Control Console to configure runtime pooling for Forms Services with the following parameters:
Table 10-1 Forms Runtime Pooling Parameters
Parameter Name | Data type | Description | Default Value |
---|---|---|---|
|
boolean |
Runtime pre starting or pooling is enabled only if true |
false |
|
integer |
Number of the runtime executables that should be spawned initially |
1 |
|
integer |
Time in minutes for which the pre started executables to exist |
0 (When set to zero the timer never starts) |
|
integer |
Minimum number of runtime executables to exist in the pool. |
0 |
|
integer |
The number of runtime executables to be created when below the minRuntimes. |
0 |
Note that prestartMin
defines the minimum number of pre-started runtimes that must exist at any time for a specific application. The minimum value must be less than or equal to what's defined for the prestartInit
parameter. The prestartMin
parameter can be modified at any time and does not require the application server to be restarted. The new entries will be picked up when a client requests a connection to a pre-started runtime process and the prestarted runtime processes have not timed out. Once they have timed out, an application uses default behavior and a minimum threshold is not maintained.
Each configuration section can specify values for these parameter. If the prestartRuntimes = true
entry is found, but there is no associating prestart parameter, then default values are used.
In a load balanced system that has multiple instances of OC4J, the various values provided for the above parameters are on a per JVM basis, and not the total for the application.
An administrator has the capability to pre-start the specified number of executables for a particular application from the Enterprise Manager Application Server Control Console. The administrator selects the required application, which alerts Forms Services. The Forms Servlet will be loaded on the start of the Web server (OC4J).
During initialization of the Forms Servlet, the formsweb.cfg file is read and the server prestarts the applications which has the prestartRuntimes parameter enabled.
The Forms Utility page provides a simple user interface to call a set of operations on the middle tier. These features will be enhanced in future releases.
Presently, only ps
(to obtain process information) and a number of arguments are available.
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 Oracle 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 classes 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 needed, rather than downloading all of the functionality classes at once.
When a form definition is loaded from an FMX file, the profile of the executing process can be summarized as:
Of these, only the Data Segments section is unique to a given instance of an application. The Encoded Program Units and Boilerplate Objects/Images are common to all application users. Forms Services maps the shared components into physical memory, and then shares them between all processes accessing the same FMX file.
The first user to load a given FMX file will use the full memory requirement for that form. However, subsequent users will have a greatly reduced memory requirement, which is dependent only on the extent of local data. This method of mapping shared components reduces the average memory required per user for a given application.
Bandwidth is a valuable resource, and the general growth of Internet computing puts an ever increasing strain on the infrastructure. Therefore, it is critical that applications use the network's capacity sparingly.
Oracle Application Server Forms Services communicates with the Java client using meta data messages. Meta data messages are a collection of name-value pairs that tell the client which object to act upon and how. By sending only parameters to generic objects on the Java client, there is approximately 90-percent less traffic (when compared to sending new code to achieve the same effect).
Oracle Application Server Forms Services intelligently condenses the data stream in three ways:
When sets of similar messages (collections of name-value pairs) are sent, the second and subsequent messages include only the differences from the previous message. This results in significant reductions in network traffic. This process is called message diff-ing.
When the same string is to be repeated on the client display (for example, when displaying multiple rows of data with the same company name), Oracle Application Server Forms Services sends the string only once, and then references the string in subsequent messages. Passing strings by reference increases bandwidth efficiency.
Data types are transmitted in the lowest number of bytes required for their value.
Latency can be the most significant factor that influences the responsiveness of an application. One of the best ways to reduce the effects of latency is to minimize the number of network packets sent during a conversation between the Java client and the Forms Server.
The extensive use of triggers within the Forms Developer model is a strength, but they can increase the effect of latency by requiring a network round trip for each trigger. One way to avoid the latency concerns adhering to triggers is by grouping them together through Event Bundling. For example, when a user navigates from item A to item B (such as when tabbing from one entry field to another), a range of pre- and post-triggers may fire, each of which requires processing on the Forms Server.
Event Bundling gathers all of the events triggered while navigating between the two objects, and delivers them as a single packet to Oracle Application Server Forms Services for processing. When navigation involves traversing many objects (such as when a mouse click is on a distant object), Event Bundling gathers all events from all of the objects that were traversed, and delivers the group to Oracle Application Server Forms Services as a single network message.
All boilerplate objects in a given form are part of a Virtual Graphics System (VGS) tree. VGS is the graphical subcomponent that is common to all Forms Developer products. VGS tree objects are described using attributes such as coordinates, colors, line width, and font. When sending a VGS tree for an object to the Java client, the only attributes that are sent are those that differ from the defaults for the given object type.
Images are transmitted and stored as compressed JPEG images. This reduces both network overhead and client memory requirements.
Minimizing resources includes minimizing the memory overhead of the client and server processes. Optimal use of the network requires that bandwidth be kept to a minimum and that the number of packets used to communicate between the client and Oracle Application Server Forms Services be minimized in order to contain the latency effects of the network.
An application developer can take steps to ensure that maximum benefits are gained from Forms Server's built-in architectural optimizations. The remainder of this chapter discusses key performance issues that affect many applications and how developers can improve performance by tuning applications to exploit Forms Server features.
The Forms Java client is only responsible to display the GUI objects. All of the Oracle Forms logic runs in Oracle Application Server Forms Services, on the middle tier. This includes inserting or updating the data to the database, querying data from the database, executing stored procedures on the database, and so on. Therefore, it is important to have a high-speed connection between the application server and the database server.
All of this interaction takes place without any communication to the Forms Java client. Only when there is a change on the screen is there any traffic between the client and Forms Services. This allows Oracle Forms applications to run across slower networks, such as with modems or satellites.
The configuration in Figure 10-1, displays how Forms Services and the database server are co-located in a data center.
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 an Oracle Forms application, several steps must be completed before the application is ready for use:
Invoke Java Virtual Machine (JVM).
Load all initial Java client classes, and authenticate security of classes.
Display splash screen.
Initialize form:
Load additional Java classes, as required.
Authenticate security of classes.
Render boilerplate objects and images.
Render all elements on the initial screen.
Remove splash screen.
Form 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 Oracle Forms 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.
Oracle Application Server Forms Services provides the following pre-configured Jar files to support typical deployment scenarios.
The following are the Jar files provided for use with Oracle JInitiator:
frmall.jar - includes all required classes
frmall_jinit.jar - same as frmall.jar but is optimized for use with Oracle JInitiator (this is the default)
frmmain.jar - contains fewer classes than frmall.jar. The other classes are downloaded as needed using a deferred mechanism. This gives a smaller download and a faster startup time.
To specify one or more Jar files, use the archive_jini setting in the named configuration section of the Forms Configuration file (formsweb.cfg). For example,
[MyApp] archive_jini=frmall_jinit.jar, icons.jar
Your archive_jini setting must use only one of the three Jar files listed, above. It may also contain any additional custom Jar files that your application uses (for example, icons.jar, as shown in the previous example). Each application can use its own archive_jini setting.
The following Jar files contain the deferred classes that are missing from frmmain.jar. They will be downloaded automatically as they are needed, so there is no need to reference them in the archive_jini setting. They are already present in frmall.jar and frmall_jinit.jar, so they are only used if you use frmmain.jar.
frmoracle_laf.jar
– classes for the Oracle Look-And-Feel
frmgeneric_laf.jar
– classes for the generic (standard) Look-And-Feel
frmresources.jar
– resource classes for languages other than US English.
The English resource classes are contained in frmall.jar
, frmall_jinit.jar
, and frmmain.jar
. frmresources.jar
will be loaded if a language other than US English is used. Note that this Jar file contains the resources for all languages other than English. Therefore you will have either the US English resource classes, or all of the language resource classes.
For more information about Oracle JInitiator, see Appendix B, "JInitiator".
The following Jar file is provided for Java Virtual Machines (JVMs) other than Jinitiator or the IE native JVM:
frmall.jar
- includes all required classes
To specify one or more Jar files, use the archive setting in the named configuration section of the Forms Configuration file (formsweb.cfg). For example,
[MyApp] archive=frmall.jar
Both of the supported JVMs for Oracle Application Server Forms 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.
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:
Control the order in which messages are sent. The order in which messages are sent is governed by two criteria:
For the initial display, the display order in the Object Navigator
During execution, the order of program changes to item properties
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'); ...
Promote similarities between objects. Using similar objects improves message diff-ing effectiveness (in addition to being more visually appealing to the user). The following steps encourage consistency between objects:
Accept default values for properties, and change only those attributes needed for the object.
Use Smart Classes to describe groups of objects.
Lock the look-and-feel into a small number of visual attributes.
Reduce the use of boilerplate text. As a developer, you should use the PROMPT item property rather than boilerplate text wherever applicable. Forms Developer 6.0 and higher includes the Associate Prompt feature, which allows boilerplate text to be re-designated as the prompt for a given item.
Reduce the use of boilerplate items (such as arcs, circles, and polygons). All boilerplate items for a given Form are loaded at Form initialization. Boilerplate items take time to load and use resources on the client whether they are displayed or not. Common boilerplate items, namely rectangles and lines, are optimized. Therefore, restricting the application to these basic boilerplate items reduces network bandwidth and client resources while improving startup times.
Keep navigation to a minimum. An Event Bundle is sent each time a navigation event finishes, whether the navigation extends over two objects or many more. Design Forms that do not require the user to navigate through fields when default values are being accepted. A Form should encourage the user to quickly exit once the Form is complete, which causes all additional navigation events to fire as one Event Bundle.
Reduce the time to draw the initial screen. Once the Java client has loaded the required classes, it must load and initialize all of the objects to be displayed before it can display the initial screen. By keeping the number of items to a minimum, the initial screen is populated and displayed to the user more promptly. Techniques that reduce the time to draw the initial screen include:
Providing a login screen for the application with a restricted set of objects (such as a title, small logo, username, and password).
On the Form's initial display, hiding elements not immediately required. Use the canvas properties:
RAISE ON ENTRY = YES
(Canvas only)
Pay attention to TAB canvases that consist of several sheets where only one will ever be displayed. For responsive switching between tabs, all items for all sheets on the canvas are loaded, including those that are hidden behind the initial tab. Consequently, the time taken to load and initialize a TAB canvas is related to all objects on the canvas and not just to those initially visible.
Tip: When using Tab canvases, use stacked canvases and display the right canvas in the when-tab-page-changed trigger. Remember to set the propertiesRAISE ON ENTRY = YES and VISIBLE = NO for all the canvases not displayed in the first screen.
|
Disable MENU_BUFFERING. By default, MENU_BUFFERING is set to True. This means that changes to a menu are buffered for a future "synchronize" event when the altered menu is re-transmitted in full. (Most applications make either many simultaneous changes to a menu or none at all. Therefore, sending the entire menu at once is the most efficient method of updating the menu on the client.) However, a given application may make only minimal changes to a menu. In this case, it may be more efficient to send each change as it happens. You can achieve this using the statement:
Set_Application_Property (MENU_BUFFERING, 'false');
The following techniques may further reduce the resources required to execute an application:
Examine timers and replace with JavaBeans. When a timer fires, an asynchronous event is generated. There may not be other events in the queue to bundle with this event. Although a timer is only a few bytes in size, a timer firing every second generates 60 network trips a minute and almost 30,000 packets in a typical working day. Many timers are used to provide clocks or animation. Replace these components with self-contained JavaBeans that achieve the same effect without requiring the intervention of Forms Services and the network.
Consider localizing the validation of input items. It is common practice to process input to an item using a When-Validate-Item trigger. The trigger itself is processed on the Forms Services. You should consider using pluggable Java components to replace the default functionality of standard client items, such as text boxes. Then, validation of items, such as date or max/min values, are contained within the item. This technique opens up opportunities for more complex, application-specific validation like automatic formatting of input, such as telephone numbers with the format (XXX) XXX-XXXX.
Reduce the application to many smaller forms, rather than one large form. By providing a fine-grained application, the user's navigation defines which objects are loaded and initialized from the Forms Services. With large Forms, the danger is that the application is delayed while objects are initialized, many of which may never be referenced. When chaining Forms together, consider using the built-ins OPEN_FORM and NEW_FORM:
With OPEN_FORM, the calling Form is left open on the client and the server, so that the additional Form on both the client and the server consumes more memory. However, if the Form is already in use by another user, then the increase in server memory is limited to just the data segments. When the user returns to the initial Form, it already resides in local memory and requires no additional network traffic to redisplay.
With NEW_FORM, the calling Form is closed on the client and the server, and all object properties are destroyed. Consequently, it consumes less memory on the server and client. Returning to the initial Form requires that it be downloaded again to the client, which requires network resources and startup time delays. Use OPEN_FORM to display the next Form in an application unless it is unlikely that the initial form will be called again (such as a login form).
Avoid unnecessary graphics and images. Wherever possible, reduce the number of image items and background images displayed in your applications. Each time an image is displayed to application users, the image must be downloaded from the application server to the user's Web browser. To display a company logo with your Web application, include the image in the HTML file that downloads at application startup. Do this instead of including it as a background image in the application. As a background image, it must be retrieved from the database or filesystem and downloaded repeatedly to users' computers.
Oracle Web Cache can be used as a load balancer with Oracle Forms applications.
The following setup instructions assume the following:
Oracle Application Server Web Cache instance running on Host A
Oracle HTTP Server instance and OC4J instance on Host B running Oracle Forms application D
Oracle HTTP Server instance and OC4J instance on Host C running Oracle Forms application D
Note that there could be more Oracle HTTP Server/OC4J instances, but only two instance pairs will be described here for purposes of simplification. The Oracle HTTP Server/OC4J instances are not clustered because Oracle Forms applications cannot take advantage of Oracle Application Server clustering.
Also note that a Web Cache 9.0.2.x cluster cannot be used. An Oracle Application Server Web Cache cluster can be used to load balance Oracle Forms starting with Oracle Application Server.
Since Forms applications are stateful, Web Cache must be configured for stateful load balancing using its session binding feature.
Configure Web Cache on Host A with the appropriate Site information for the Forms application, as well as Origin Server and Site-to-Server Mapping information for the Oracle HTTP Server instances running on Hosts B and C. When configuring Origin Server information for Hosts B and C, be sure to configure a ping URL that will detect whether Forms application D is running, for example, /forms/frmservlet?ifcmd=status
.
To Configure Session Binding in Web Cache:
Add the following code to the orion-web.xml file located in $ORACLE_HOME\j2ee\OC4J_BI_Forms\application-deployments\formsapp\formsweb\orion-web.xml:
<session-tracking cookies="enabled"> </session-tracking>
Issue this command:
dcmctl updateconfig -ct oc4j
Restart OC4J_BI_Forms with:
opmnctl restartproc gid="OC4J_BI_Forms"
Log on to the Web Cache Manager.
In the navigator pane, select Origin Servers, Sites, and Load Balancing |Session Binding.
In the Session Binding screen, select Default Session Binding, then select Edit Selected.
The Edit Session Binding dialog box appears.
From the Please select a session: pull-down list, select Monitoring | Health Monitor.
Configure an Inactivity Timeout that is appropriate for Oracle Forms application D.
Click Submit.
Apply changes and restart Oracle Application Server Web Cache.
Using a browser, point it to the Web Cache host and access Oracle Forms application D. Ensure that the application works as expected. Keep the browser window open.
Identify the Oracle HTTP Server/OC4J that handled the requests. For example, assume this is Host B and shut down the Oracle HTTP Server/OC4J on that host. Now only the Oracle HTTP Server/OC4J running on Host C will be accessible.
Using the same browser that is running the Oracle Forms client, access Oracle Forms application D again. The request will fail, and the Forms client will lose its session. Remember that Oracle Forms session state is not replicated among OC4J instances.
Next, use the browser to start a new Forms session. Web Cache will direct the requests to the remaining Oracle HTTP Server/OC4J running on Host C. Ensure that the application works as expected.
Restart the Oracle HTTP Server/OC4J on Host B. Using a browser, log on to the Web Cache Manager. In the navigator pane, select Administration | Monitoring | Health Monitor.
On the Health Monitor screen, make sure that Host B is marked UP.
For additional information about Web Cache, see Oracle Application Server Web Cache Administration and Deployment Guide.