Using Single Thread Model Servlets - Oracle Oracle9i Application Manual

Release 1.0.2 for aix-based systems, compaq tru64 unix, hp 9000 series hp-ux, linux intel, and sun solaris intel
Hide thumbs Also See for Oracle9i:
Table of Contents

Advertisement

Using Single Thread Model Servlets

Oracle recommends that you write your servlets to implement the
SingleThreadModel (STM) interface. An application that was modified to
implement the STM interface demonstrated a 25% improvement in response time,
probably due to a decrease in synchronization bottlenecks.
It is also much easier to manage database connections with STM servlets. The
database connection can be set up in the init() method of the servlet, and closed
in the destroy() method. When executing the servlet's doGet() or service()
method, you need not be concerned with obtaining a database connection.
Alternatively, you can use JDBC connection caching.
There are three parameters in the zone.properties file that impact the performance
of STM servlets in particular. These govern:
Because it is very costly to generate instances while the system is running, Oracle
recommends that you set your minimum to equal your maximum value. The
optimum value depends somewhat on how many connections your database server
can handle. This should be split among the JServ processes, as follows:
Total DB connections / Number of JServ processes = Number of STM servlet
See
number of JServ processes for your application, and
for the steps to configure them. Suppose you've determined that you want 10
servlet instances per process. Then, in the properties file for your zone, set:
If the request is not part of a session, mod_jserv selects an engine based on
b.
the process ID of the httpd process and the number of entries in the list of
available JServs, as follows:
JServ_id to handle the request = httpd_pid % number of JServs in the list
This method distributes requests across the available JServ engines fairly
evenly.
The minimum number of servlet object instances that will be generated and
available after the servlet class is loaded
The maximum number that can be generated
The number that should be generated if the available instances are insufficient
Chapter 3, "Sizing and Configuration"
Optimizing Servlet Performance
instances per process
for suggestions on determining the right
"Load Balancing"
Optimizing Apache JServ 5-7
on page 5-4

Advertisement

Table of Contents
loading

This manual is also suitable for:

Oracle9i application server

Table of Contents