Table of Contents Previous Section

Performance Testing

The WebObjects package comes with a special adaptor that allows you to record a session and a tool that helps you play back a recorded session. Using these tools, you can test your application setup to determine if you have the appropriate number of instances running, the appropriate amount of memory allocated, and so on.

Note: You cannot use the recording and playback tools on applications that use HTML frames.

To use the recording and playback performance testing tools, do the following:

  1. Copy the adaptor WebObjects-Recording from NeXT_ROOT/NextLibrary/WOAdaptors/CGI to your web server's cgi-bin directory.
  2. Use the Monitor to create an instance of the application.
  3. Start the application instance you just created. To do so, open a command-shell window and enter the command line as shown in the section "Starting Up Applications From the Command Line." Use the -n option (which must be used in conjunction with the -a option) to specify the instance number. Also use the -browser OFF option so that the application does not automatically launch in your web browser. For example, your command line might look like this:
  4.         MyApp -a WODefaultAdaptor -n instanceNumber -c -browser OFF 
    
    

  5. In your web browser, enter this URL:
  6. http://localhost/cgi-bin/WebObjects-Recording/MyApp?file=completePath
    
    

    where completePath is the directory in which you want to store the recorded session. The adaptor appends a .rec extension to the path you specify.

  7. Using the web browser, run a session of your WebObjects application. You may want to record what you believe to be a typical session, or you may want to perform a session that would put a maximum load on your system. For example, you may want to record a session that performs as many database fetches as possible.
  8. Important: During recording, only one user may be accessing the application. Your session must not include any backtracking to a previously displayed page. If you backtrack, you'll get unpredictable results.

    As you run the application, the WebObjects recording adaptor records each request and response to a separate file in the directory you specified.

  9. When you have finished the session, close the browser window. To prevent accidental calls to the WebObjects-Recording adaptor, remove it from your server's cgi-bin directory.
  10. Open a command shell window and enter this command:
  11.         WOPlayback -R completePath.rec -H hostname
    
    

    where completePath.rec is the directory that contains the recorded session and hostname is the name of the host on which you want to run the recorded session.

    The WOPlayback tool plays the recorded session repeatedly until you explicitly stop it (for example, by pressing Control-C in a command shell window). It is possible to run several versions of WOPlayback at the same time to put more load on the server.

If you want, you can specify other options to the WOPlayback tool as well. The following is a list of the available options:

-P http_port
The port number of your HTTP server (the default is 80).
-C count
Plays back the session count number of times instead of indefinitely.
-S sleep_time
The number of seconds to wait in between requests. The default is 0.
-p adaptor_path
Sends request using the adaptor_path instead of the recorded URL. For example, suppose you recorded a session using a Netscape server whose cgi-bin directory is named cgi-bin and you want to play it back using the Microsoft Internet Information Server, whose cgi-bin directory is named Scripts and has WebObjects.dll as the adaptor name. Your adaptor_path is
                /Scripts/WebObjects.dll

If you'd like to improve the average response time that resulted from this test, read the next section, "Improving Performance" for guidelines on how to do so.

Table of Contents Next Section