beautypg.com

Apple WebObjects 3.5: Serving User Manual

Page 28

background image

Administrative Tasks

29

The WebObjects Developer’s Guide offers some suggested coding
practices to improve performance.

Enable component-definition caching for all applications.

Component-definition caching is off by default as a convenience for
programmers debugging applications. When the application is
deployed, component-definition caching should be enabled so that
each component’s HTML and declarations files are parsed only once
per session. Component-definition caching can be enabled
programmatically by sending

setCachingEnabled:

to the WOApplication

object (in Java, WebApplication). You can also use the Monitor to
enable caching by doing the following:

a. In the Declared Apps list, click the inspector button for the application to

display the application inspector.

b. Click the More button to display the application instance inspector.

c. Click the Component caching check box.

d. Click the Save Settings button at the bottom of the frame.

Shut down and restart application instances periodically.

Because no program is ever perfect, WebObjects applications may leak
a certain amount of memory per transaction. For this reason, you
should periodically shut down and start up each application instance as
described in “Periodically Shutting Down the Application” in this
guide.

Perform load balancing or increase the listen queue depth to improve
response time for a specific application.

– If the response time is consistently slow, add more application instances so

that the load is balanced among those instances. For more information, see
the section “Load Balancing” in this guide.

– If the response time is sometimes acceptable and sometimes slow, consider

increasing the size of the listen queue, which holds requests awaiting pro-
cessing. For more information, see the section “Increasing the Listen Queue
Depth” in this guide.

Consider changing the physical configuration of your system.

Determine the size of a single application instance (you can look this
up on the application’s WOStats page) and multiply that number by