Wednesday, January 7, 2009

Run Setup steps for remote profiling on Sun Sparc box

1. Install JProfiler :
on the Sun Sparc box, say, /local/apps/jprofiler. Also you need to install JProfiler on your local box.

2. Create a JProfiler session on your local box
2.1 Start JProfiler on your local box and you will see a Quickstart wizard.
If you do not see this wizard go to Help | Show Quickstart Dialog (or click Shift - F1)
2.2 Select the radio button labled "An application server, locally or remotely", click Next
2.3 Select "Generic Application Server" from the dropdown, and Next
2.4 Check "On a remote computer" and select "Solaris sparc 32/64" from the dropdown. Click Next
2.5 Enter the server name (URL like: server1.yourcompany.com), then click Next
2.6 Enter the jprofiler install directory path on the Solaris box (like '/local/apps/jprofiler') then click Next
2.7 On next page, select:
JVM Vendor: Sun
Version: 1.5.0
Mode: hotspot
2.8 Click Next and enter port number 8082 (this may differ per Solaris box, 9130 appears to be a good alternate)
2.9 check "Don't wait, start immediately" and click Next
2.10 Enter the '/local/apps/jprofiler' on the top text box and click Next
2.11 On this dialog box, you will see an instruction. You only need to take a note on the port=XXXX and id=YYY. Make sure the port and id match with the ones in resin.conf.jprofiler that you will create below. Go to the next step.
2.12 Click Next, check "No, I will start the session later" and click Finish

3. On Sun server box
3.1. Create a new shell script to run the server:
LD_LIBRARY_PATH="/local/apps/jprofiler/bin/solaris-sparc"
export LD_LIBRARY_PATH
3.2 Add a new configuration file to run to be used by the above shell script
add following two lines to the beginning of JVM section:
-agentlib:jprofilerti=port=8082,nowait,id=115,config=/local/apps/jprofiler/config/config.xml
-Xbootclasspath/a:/local/apps/jprofiler/bin/agent.jar
Change the value of the id to match the session id you created above
The port number may be different, depending on the availability on the box (9130 seems to be a good alternate port to use). Remember, it must match what you created in your JProfiler session above.
Remove lines following lines if they exist:
-Xdebug
-Xnoagent

3.3 Copy the config.xml file from your local box to /local/apps/jprofiler/config
3.4 Start the app by running on the Solaris box

4. Start JProfiler session that was created a few steps back
Go to Session | Start Center
Find your session on the Open Session tab
Click Start
On the Session Startup screen click OK and you will attach the profiler to the Resin instance.

No comments:

Post a Comment