---------------------------------------------------------------- BEFORE YOU POST, search the faq at <http://java.apache.org/faq/> WHEN YOU POST, include all relevant version numbers, log files, and configuration files. Don't make us guess your problem!!! ---------------------------------------------------------------- > Subject: RE: How to optimize our servlet using OptimizeIt and Apache+JServ ? > From: "Mader, Cary J" > Date: Mon, 3 Jan 2000 14:35:03 -0600 > > There is an item in the FAQ on using OptimizeIt. You have to run JServ > manually, so check your Apache configuration to see if you are starting > the JServ module automatically or manually. You might want to make sure > you can start JServ manually first. After that, all you really need to > do is excecute the OptimizeIt class, giving it a few parms and the JServ > engine class as the class you wish to Optimize. > > It's been a while since I've run JServ via OptimizeIt, so I can't give > specifics off the top of my head, but the FAQ should get you about 95% > of the way there. If you are still having problems, send me a note, > and I'll go back and look at what I did to run it. > > Cary > Thanks Cary, it was the way to do it (strange that sometime specific tutorial are wrong ...). Thanks also to the Intuive support that send me the notice below Cool I could profile my servlet now ! Pierre Jourdan ---------------------------------------------------------- This tutorial explains how to profile a Java Servlet running with Apache JServ 1.1. In this document: <OptItDir> is the directory where OptimizeIt has been installed (ex: c:\OptimizeIt\OptimizeIt302D). <JServDir> is the directory where Apache JServ has been installed (ex: c:\Program Files\Apache JServ 1.1). 1) Configuring Apache JServ Changing virtual machine parameters Edit the file <JServDir>\conf\jserv.properties Look for the line starting with wrapper.bin= . The remainder of the line contains the path to the virtual machine that will execute the servlet engine. Note the type (1.1 or 1.2) of this virtual machine, next step will depend on it. Append after the wrapper.bin= line the following line: if the type of the virtual machine is 1.1: wrapper.bin.parameters=-noclassgc -Djava.compiler=NONE -DOPTITDIR="<OptItDir>" if the type of the virtual machine is 1.2: wrapper.bin.parameters=-classic -Xnoclassgc -Xrunoii -Djava.compiler=NONE -DOPTITDIR="<OptItDir>" Append the following line after the last line starting with wrapper.path=, or if there is no such line, after the previous added line wrapper.bin.parameters=: wrapper.path=<OptItDir>\lib Append the following line after the last line starting with wrapper.classpath=: wrapper.classpath=<OptItDir>\lib\optit.jar Copying the OptimizeIt servlet Copy the OptimizeIt servlet (<OpItDir>\lib\servlet\OptimizeIt.class) into the JServ servlet directory (<JServDir>\servlets). Restarting JServ Once the config file has been updated, you need to start (or restart if it is already started) the Apache server. 2) Start the OptimizeIt servlet Invoke the servlet from a web browser. The URL should look like http://localhost/servlet/OptimizeIt In the HTML page that the servlet provides, change the port number if necessary. Select the "Disable memory profiler" option if you only want to focus on CPU usage. Select "Enable OptimizeIt's audit system API" if your code enables/disables the profiler by using OptimizeIt's audit system API Press the "Start OptimizeIt Audit System" button to start the profiler. Once this operation is done, you should see a message in your web browser indicating that OptimizeIt's audit system is running. 3) Attaching from OptimizeIt Now that Java Web Server is running with OptimizeIt profiler, you can start OptimizeIt and attach to the virtual machine. Start OptimizeIt from the Start menu. Close the Edit Settings panel by pressing the OK button. From the Program menu, select Attach. Change the port number and the hostname if necessary. Press the Attach button. Note: OptimizeIt does not have a "detach" function. If you press the stop button in OptimizeIt, the servlet engine exits and restarts automatically. After doing this, you need to invoke the OptimizeIt servlet to restart the profiler. 4) Filtering resources used by JServ OptimizeIt provides filters for filtering resources used by JServ. In order to use filters, you must create an OptimizeIt setting for the profiling session, turn on the JServ filter, and then attach by using the Attach now button or pressing the play button. Start OptimizeIt's audit system by using OptimizeIt's servlet. Start OptimizeIt from the Start menu. Close the settings editor by pressing OK. From the File menu, select New In the Edit Settings panel select Remote Application in the Program type part. Change the hostname or the port number if necessary. Switch to the Filters section by clicking the Filters tab. In the table, find the line with the name Apache JServ. If you want to ignore CPU or time consumed by JServ, check the Ignore CPU usage column on that line. If you want to ignore object allocations performed by JServ, check the Ignore Memory usage column on that line. Press the Attach now button. Note: OptimizeIt settings can be saved for subsequent usage. This is done by using the save menu. 5) Starting OptimizeIt profiler from your Java code While the OptimizeIt servlet is convenient to start profiling quickly, you may want to automatically start OptimizeIt profiler with one of your servlet. That way, you don't have to invoke the OptimizeIt servlet to start the audit system before testing your servlets. Starting OptimizeIt profiler can be easily done by using OptimizeIt's API. OptimizeIt's API is documented in OptimizeIt user manual, chapter 9. The following code demonstrates how to start the profiler from your servlet: import intuitive.audit.Audit; ... static boolean isProfilerStarted = false; if(!isProfilerStarted) { /* Start OptimizeIt's profiler */ Audit.start(1470, Audit.PROFILERS_ALWAYS_ENABLED); isProfilerStarted = true; } ... Note: you will need to add <OptItDir>\lib\optit.jar to compile this code Once OptimizeIt's profiler is running, you can start OptimizeIt and attach to the servlet engine. Copyright (c) 1997, 1998, 1999 Intuitive Systems Inc. All rights reserved. Specifications subject to change without notice. OptimizeIt is a trademark of Intuitive Systems, Inc. Java and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc. All other brand names and products are trademarks or registered trademarks of their respective holders. ---------------------------------------------------------- > -----Original Message----- > From: Pierre Jourdan [mailto:[EMAIL PROTECTED]] > Sent: Thursday, December 30, 1999 9:15 AM > To: [EMAIL PROTECTED] > Subject: How to optimize our servlet using OptimizeIt and Apache+JServ ? > > ---------------------------------------------------------------- > BEFORE YOU POST, search the faq at <http://java.apache.org/faq/> > WHEN YOU POST, include all relevant version numbers, log files, > and configuration files. Don't make us guess your problem!!! > ---------------------------------------------------------------- > > Hi all, > > I'm using Apache1.39, JServ1.1beta3 on WindowsNT 4.0SP4 > with jdk1.3b of sun. > > My servlet is running quite well, using JDBC, Sybase Application server, etc > ... > But now, I would like to optimize it and I have only OptimizeIt as > application. > > I read the FAQ, but doesn't find the answer .... > > Here are the instructions from OptimizeIt3.02 documentation to run a servlet > engine : > This document provides you with a simple solution to profile your servlets > running with virtually any servlet engines. > -- -------------------------------------------------------------- Please read the FAQ! <http://java.apache.org/faq/> To subscribe: [EMAIL PROTECTED] To unsubscribe: [EMAIL PROTECTED] Archives and Other: <http://java.apache.org/main/mail.html> Problems?: [EMAIL PROTECTED]