Oracle Forms 10g Tuning tips

Although there are quite some new screenbased application techniques, a lot of companies use the traditional Oracle Forms & Reports.

Even with the transition to an entire new application server, WebLogic, Oracle has Â ported their traditional applications like Forms to the 11g stack.

In this article I will guide you to some performance improving techniques I gained from my year to year experience working with Middleware products

The Â Oracle HTTP Server

Oracle HTTP listener receives the request.

It forwards the request to MOD_OC4J that handles all servlet requests. MOD_OC4JÂ decides if it is intended for Forms since the path “/forms/frmservlet”

matches one of the OC4J mount directives in the forms90.conf or forms.conffile (the one for the Forms Servlet).

MOD_OC4J maps the request to the Oracle Forms application (whose context rootÂ is /forms90 or /forms) in the OC4J servlet engine.

MOD_OC4J passes the request to the Forms Servlet (using the f90servlet or frmservletÂ servlet mapping specified in the web.xml file).

The Forms Servlet (running in OC4J) processes the request as follows: It opensÂ the servlet configuration file (formsweb.cfg by default)

and starts to donwload the file to the client machine.

If the paramter envfile is not set, the default configuration fileÂ (<ORACLE_HOME>/forms90/server/formsweb.cfg) orÂ (<ORACLE_HOME>/forms/server/formsweb.cfg)is used.

HTTP Tuning

These parameters in the httpd.conf are relevant for tuning:

– KeepAlive

– MaxClient

– MinSpareServers

– MaxSpareServers

– KeepAliveTimeout

– MaxRequestsPerChild

– ThreadLimit

– ThreadsPerChild

– Global-thread-pool

There are some possibilities for tuning which are listed in more detail in the

following:

1. Limit the number of processes (HTTPD on Unix; THREAD on NT) to avoidÂ spawning too many HTTPD processes (which is memory consuming). Donâ€™t set the LD_ASSUME_KERNEL option!

2. Set the following directive in the Oracle HTTP Listener configuration fileÂ httpd.conf:

KeepAlive Off

If you must use KeepAlive On (for example, for another application), makeÂ sure that KeepAliveTimeout is set to a low number (for example, 15 seconds,

which is the default). It keeps the current TCP/IP connection open for awhile after the HTTP transaction ends, allowing that same connection to be used for several subsequent HTTP transactions. So it reduces latency, and speeds up both the client and server connections. But for forms every new connection is a new transaction.

3. Set the maxClient directive to a high value.

The best is to let the HTTP Listener control to create more HTTPD daemons.

Therefore set the maxClient directive to a high value in the configurationÂ file (httpd.conf).

However, you need to consider the memory available on the system when setting this parameter. You can let the HTTP Listener determine when to create more HTTPD daemons. Therefore, set the MaxClients directive to a high value in the configuration file (httpd.conf). However, you need to consider the memory available on the system when setting this parameter.MaxClients=256 means that the listener can create up to 256 HTTPD processes to handle concurrent requests.

4. MinSpareServers / MaxSpareServers

If your HTTP requests come in bursts, and you want to reduce the time toÂ start the necessary HTTPD processes,

you can set MinSpareServers and MaxSpareServersÂ within httpd.conf) to have an appropriate number of processes ready.

However, the default values of 5 and 10 respectively are sufficient for mostÂ sites.

5. The MaxRequestsPerChild directive sets the limit on the number of requests

that an individual child server process will handle.Â After MaxRequestsPerChild requests, the child process will die.

If MaxRequestsPerChild is 0, then the process will never expire.Â This directive sets the maximum configured value for ThreadsPerChild for the

lifetime of the Apache process. Any attempts to change this directive duringÂ a restart will be ignored, but ThreadsPerChild can be modified during a

restart up to the value of this directive.

6. ThreadsPerChild

This directive sets the number of threads created by each child process.Â The child creates these threads at startup and never creates more.

OC4J tuning Section

You can specify the use of a thread pool for an OC4J process through theÂ global-thread-pool element in the server.xml file.

If you do not specify the use of a thread pool, OC4J will create theÂ number of threads that is necessary required to service your application

workload in an unbounded fashion.

You can configure OC4J to create a single thread pool containing all threads.Â The other way is that two thread pools are created containing different types

of threads, through the <global-thread-pool> element in the server.xml file.

If you do not specify this element, then an unbounded number of new threads areÂ created as needed for the OC4J process.

The queue attributes should be at least twice the size of the maximumÂ number of threads.The minimum and maximum number of worker threads should be a multiple of theÂ number of CPUs installed on your machine and fairly small.Â The more threads you have, the more burden you put on the operating system andÂ the garbage collector. The minimum that you should set is 10.

When running benchmarks or in a production environment, once you figure outÂ the right number of threads, set the minimum to the maximum number, and the

keepAlive attribute to negative one (-1).

Take care when you modify these parameters. It helps in many cases whenÂ increasing them. But if the values are too high estimated then the system

starts dramatically to swap and takes most of the time to handle the swappingÂ process. And degrade the system uses memory and CPU time!

To create a single pool, configure the min, max, queue, and keepAliveÂ attributes. To create two pools, configure the min, max, queue, and keepAlive attributes for the first pool and the cx-min, cx-max, cx-queue, and cx-keepAlive attributes for the second pool.

In order to activate two thread pools, you must configure all the attributes for the first thread pool, which includes min, max, queue, and keepAlive. If any of these attributes is not configured, you cannot configure the second pool.

MaxBlockTime is the time in milli seconds to wait when reading data from theÂ Runform process.

e.g. a long query, lots of complex processing

(default = 1000 milli sec)

/j2EE/OC4J_BI_Forms/application/forms90app/forms90web/WEB-INF/web.xml

or

/j2EE/OC4J_BI_Forms/application/formsapp/formsweb/WEB-INF/web.xml

Example

<servlet>

<servlet-name>l90servlet</servlet-name>

<servlet-class>oracle.forms.servlet.ListenerServlet</servlet-class>

<init-param>

<param-name>maxBlockTime</param-name>

<param-value>1800000</param-value>

</init-param>

</servlet>

or

<servlet>

<servlet-name>lservlet</servlet-name>

<servlet-class>oracle.forms.servlet.ListenerServlet</servlet-class>

<init-param>

<param-name>maxBlockTime</param-name>

<param-value>1800000</param-value>

</init-param>

</servlet>

Explained

For long requests (like querying a big table), the ListenerServlet waits for a default time of 1 second for the Forms runtime process to complete the request If the request is not completed then the Listener Servlet sends a busy response to the client asking the client to retry.

The client sends a retry zero content length request to check if the query isÂ complete.This default time of 1 second can be configured using Listener Servlet

parameter called maxBlockTime

OC4J Load Balancing for Forms

The easiest way to do this is to increase the number of oc4j processes.

Choose Oracle Enterprise Manager (OEM) Website

–> Select the Midtier instance

–> OC4J_BI_FORMS

–> Server properties.

Choose Multiple VM Configuration and there increase the “Number of process”.

Check for Island ID (default = 1).

Save the changes.

This can also be seen in the opmn.xml file under the opmn directory of the Midtier.

But take care if you have defined 2 OC4J instances and you have set theÂ Parameter -Xms=512M. Â The instance then allocates 1,1 GB Memory( 2* 515MB).

If you set this parameter (Xmx and Xms) you have to be sure that you have enough physical memory. Otherwise you will get an error message when you try to start the instance.

If run into OC4j timeouts you can continue to change following optionsÂ that can in the mod_oc4j.conf file:

Oc4jConnTimeout 30

Oc4jCacheSize 0

Oc4jUseKeepalive on

If you want to loadbalance, and there are two hosts in an Oracle Application Server cluster: Host_A and Host_B. Each has Oracle HTTP Server and OC4J processes running on them, then add the following to the mod_oc4j.conf:

Oc4jSelectMethod random:local

Oc4jRoutingWeight Host_A 3

Oc4jRoutingWeight Host_B 2

Oc4jRoutingWeight directives are ignored. mod_oc4j on Host_A randomly routes all requests to OC4J processes on Host_A, mod_oc4j on Host_B randomly routes all requests to OC4J processes on Host_B.Â mod_oc4j on all the machines route requests equally to OC4J processes on Host_A, Host_B, in a round robin manner.

quick connections at server peak times, which shortens the server-sideÂ application startup time. Runtime pooling is useful for situations 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.

Example formsweb.cfg

[appn_b]

form=login_appn_b.fmx

prestartRuntimes=true

prestartInit=5

prestartMin=4

prestartIncrement=3

prestartTimeout=5

FORMSxx_TIMEOUT

This parameter specifies the amount of time (in minutes) before the FormsÂ Server process is terminated when there is no client communication with the Forms Server. The internal default value is 15, and valid values are integers between 3 – 1440 minutes.

Often it happens that the client does not provide any action and Forms startsÂ to terminate the communication between the client and the Forms runtime engine process

This raises errors like FRM-92050, FRM-92100, FRM-92101

Heartbeat

This parameter sets the frequency at which a client sends a packet to theÂ server to indicate that it is

still running (default = 2 min).

Set this parameter value greater than the value specified for theÂ FORMSnn_TIMEOUT variable.

For example set it to 7 minutes as follows after the serverArgs parameter:

For Internet Explorer:

<OBJECT

…

<PARAM VALUE=”7″>

For mozilla:

<EMBED

….

heartBeat=”7″

If a user is idle, (that is, if they do not use their Form forÂ five minutes) FORMSxx_TIMEOUT kicks in. The higher value given for the

networkRETRIES is ONLY applicable when deploying Forms over the web via theÂ Forms Listener Servlet architecture, and NOT the standard Forms Server

Forms specific

This section describes forms specific items

REDUCE NETWORK TRAFFIC

This goal was mentioned before. There a number of tips that affect the efficiency of your forms and that you should work into your initial design. Reducing network traffic is the name of the game for tuning web-deployed forms. Most of the tuning effort required is between the application server and client, as this is the most complex connection and the one that is most unfamiliar to Forms developers. It is useful to review some guidelines for reducing database server network traffic.

OPTIMIZE THE CLASS FILE LOADING

The initial load time of the Java applet can be a bottleneck Â with users because it seems longer than the form startup in client/server environments. Part of this time is spent in loading the Java class files on the client side. You can optimize this

task using the following tips. The following list refers to Java Archive (JAR) files that are collections of the Java classes used to Designing, Developing, and Deploying Applications

render objects. You can create and open and manage these files using an archive utility such as WinZip. Most classes are named descriptively, so you can check whether a particular function is in a particular JAR file.

Load a smaller JAR file

JAR files are cached if you use JInitiator. This helps reduce the initial download time to a

minimum. Use the ARCHIVE parameter in your starting HTML file to load one or more JAR files. For example:

PARAM NAME=â€œARCHIVEâ€ VALUE=â€œfweb.jar,icons.jarâ€. The FWEB.JAR file contains all but the LOV classes and is the one to use if you want to load all common classes when starting up.

Tune the JAVA client Cache

The default Java memory cache on the client is xxMB. Compare that number with memory as the application is running (using a system monitor such as the Windows NT Task Manager), and ensure that you have enough cache space available in memory. Increasing physical memory will help if you are running out of memory and swapping to disk. Freeing memory by closing other applications will also help.

Locate the JAR file centrally

JAR files are housed on different application servers in a load-balancing arrangement,

the same JAR files could be downloaded from different servers because the classes are cached relative to the server.

Locate the JAR files centrally if you have a load-balancing configuration.

Use the Deferred-Load Feature Â A deferred-load feature allows you to embed references to other JAR files within a JAR file. The referenced files will not load immediately, but will wait until the class in that file is required. This deferred

loading means that the form can display faster initially, although other classes that are required will be loaded as needed.

Store the .GIF icon files in the JAR file.

This saves download time. .GIF files are used for icons on buttons in webdeployed forms instead of .ICO Â files. Some icons are actually supplied by the Runtime engine and do not require .GIF files at all. There is no known list of these icons, but you can experiment with the icons that are used by the default Forms

toolbar (exit, save, etc.). The images will display even if you delete those icons from the icon directory.

Store beans in a JAR Â If you are using Java code (JavaBeans or Pluggable Java Components), store them in the JAR file as well to speed up the download

REDUCE BANDWIDTH USAGE

The key factor that differentiates web-deployed forms from client/server forms is their use of the network. Anything you can do to reduce network traffic (that uses available bandwidth, or capacity) will speed up the way the forms load or run. The following points address this principle.

â€¢ Â Reduce the number of boilerplate text objects, and use the prompt property instead. Boilerplate text is another object that needs to be rendered.

â€¢ Â Reduce the number of boilerplate graphics. Lines and rectangles are optimized, but other types are not.

â€¢ Â Change navigation Â If your form contains many windows, allow the user to navigate to those other windows by clicking an OK or Done button instead of by pressing TAB to navigate through items. If the user does not need to change anything in those items, it is a waste of time to have to navigate to them. In addition, more triggers will fire as you navigate through items (such as POST-TEXT-ITEM and WHEN-NEW-ITEM-INSTANCE). If the user can skip to the next window with a button, the network traffic required by the item triggers will be eliminated.

â€¢ Â Use a simple startup form with just a few items on it. An example would be a logon screen with only a few items and graphics. This loads faster. Â Designing, Developing, and Deploying Applications

â€¢ Â Hide objects not initially required. Set the canvas property Raise on Entry to â€œYes.â€ Set other objectsâ€™ Visible property to â€œNo.â€ Also set Raise on Entry to “Yes.” Neither of these are the default values. When the cursor navigates to the item, Forms will automatically display the canvas. You can also issue a SHOW_VIEW call to set the Visible property to â€œYesâ€ programmatically. Tab canvases load all objects for the entire set of tabs at the same time. Set the Visible properties of all items to â€œNoâ€ to counteract this. Set them back to â€œYesâ€ when you navigate to a particular tab.

About Author

Started in pharmacy, I made the change to IT in 1996. I am an Oracle Fusion Middleware Architect at AMIS, with focus on technical infrastructure, Serverside solutions, installing, administering, configuring the Oracle Fusion Middleware stack. My experience is from integrations at telco´s using Oracle AIA, Oracle Portal, OID, Forms&Reports, Discoverer upto the latest Oracle WebLogic 11g releases with practically all Oracle products running on top of it

1 Comment

Michel Schildmeijer

Started in pharmacy, I made the change to IT in 1996. I am an Oracle Fusion Middleware Architect at AMIS, with focus on technical infrastructure, Serverside solutions, installing, administering, configuring the Oracle Fusion Middleware stack. My experience is from integrations at telco´s using Oracle AIA, Oracle Portal, OID, Forms&Reports, Discoverer upto the latest Oracle WebLogic 11g releases with practically all Oracle products running on top of it

meta

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 236 other subscribers

Email Address

About

AMIS is internationally recognized for its deep technological insight in Oracle technology. This knowledge is reflected in the presentations we deliver at international conferences such as Oracle OpenWorld, Hotsos and many user conferences around the world. Our AMIS Technology Blog, the most referred Oracle technology knowledge base outside the oracle.com domain. However you arrived here, we appreciate your interest in AMIS. Link to our Google+ Profile AMIS