Antop
Brain to Blog
Antop
전체 방문자
936,436
오늘
3
어제
27
  • 분류 전체보기 (167)
    • Ubuntu Developer (0)
    • Mini Project (12)
    • Request Sample (1)
    • Study (5)
      • Vue.js (2)
      • Hadoop (3)
    • Java+ (23)
      • Trouble Shooting (5)
      • Example (8)
    • Framework (22)
      • Struts (3)
      • Spring (3)
      • Spring OSGi (2)
      • Spring Security (3)
      • Hibernate (9)
      • Mybatis (1)
    • Android (1)
    • Oracle Solution (40)
      • Tutorial for Oracle Coheren.. (1)
      • PO Processing (17)
      • BPM 11g Foundation Training (11)
      • Oracle Service Bus 11g Hand.. (5)
      • BPEL (3)
      • Trouble Shooting (2)
    • JavaScript (5)
      • jQuery (2)
      • Ext JS (1)
    • Tools (12)
      • Eclipse (11)
      • Maven (1)
    • Database (6)
      • Oracle (3)
      • MySQL (2)
    • Server (30)
      • Ubuntu (16)
      • WebLogic (7)
      • VMware ESXi (6)
    • Etc (9)
      • Scrap (4)
      • Link (1)
      • Game (2)

블로그 메뉴

  • 홈
  • 태그
  • 미디어로그
  • 위치로그
  • 방명록

공지사항

인기 글

  • Spring + @Lazy
    2019.08.05
    Spring + @Lazy
  • Mybatis Interceptor + RowBounds ⋯
    2017.12.12
  • org.springframework.dao.EmptyRes⋯
    2010.10.10
  • Spring Message Source from Datab⋯
    2013.03.03
    Spring Message Source from Datab⋯
  • Mockito.thenThrow() 주의사항!
    2021.09.25

태그

  • Java
  • extjs
  • Eclipse
  • Struts
  • mybatis
  • BPM
  • API
  • VMware
  • xml
  • SOA
  • Spring
  • MySQL
  • JSP
  • esxi
  • oracle
  • ORM
  • osb
  • hibernate
  • ubuntu
  • maven
  • LAB
  • EJB
  • Ajax
  • Weblogic
  • JavaScript
  • JDBC
  • 하이버네이트
  • JSON
  • BPEL
  • jQuery

최근 댓글

  • 소스를 오픈 해주셔서 감사합니다. 출처 남기고 긁어가겠습⋯
    헤르메스의날개
  • 드라이버에 의존하는것보다 확실하게 하는게 좋긴 하겠네요
    망고스틴
  • 비슷한걸 개발하면서 어떻게 해야되나 jsp단에서 jstl로⋯
    홍마초
  • 잘 보고 갑니다...
    딸랑딸랑
  • 잘 보고 갑니다...
    이웃사촌

최근 글

  • Mockito.thenThrow() 주의사항!
    2021.09.25
  • Spring + @Lazy
    2019.08.05
    Spring + @Lazy
  • [Kotlin + Spring] Maven configur⋯
    2019.05.26
  • Installation Vue.js (Eclipse)
    2018.05.24
    Installation Vue.js (Eclipse)
  • Installation Vue.js (WebStorm + ⋯
    2018.05.21
    Installation Vue.js (WebStorm + ⋯

티스토리

hELLO · Designed By 정상우.
Antop

Brain to Blog

Eclipse + TPTP Remote
Tools/Eclipse

Eclipse + TPTP Remote

2012. 1. 20. 21:23
반응형
Eclipse + TPTP (Eclipse Test & Performance Tools Platform) 에 이어서 원격지에 있는 WAS 를 프로파일링 해봅시다.

Ubuntu 11.04 32bit 에서 테스트 하겠습니다.

$ uname -a
Linux nerv.kr 2.6.38-8-generic-pae #42-Ubuntu SMP Mon Apr 11 05:17:09 UTC 2011 i686 i686 i386 GNU/Linux

http://dev.eclipse.org/viewcvs/viewvc.cgi/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/packaging_md/linux/getting_started.html?root=TPTP_Project&view=co



Setting Up Agent Controller

서버에 심어둘 Agent Controller(AC)를 다운로드 합니다.

http://www.eclipse.org/tptp/home/downloads/


다운로드 받아서 압축을 풉니다. (전 "opt/tptpAC" 에 풀었습니다.)

bin 디렉토리의 SetConfig.sh 스크립트를 한번 실행해줍니다.

1. JVM 위치 : 디폴트 값이 맞다면 그냥 엔터로 넘기시면 됩니다.
2. 네트워크 엑세스 : ALL
3. 보안 사용 : 패스

/opt/tptpAC/bin# ./SetConfig.sh
Specify the fully qualified path of "java" (e.g. /usr/java1.4/jre/bin/java):
  Default>"/usr/lib/jvm/java-6-sun-1.6.0.26/jre/bin/java" (Press <ENTER> to accept the default value)
  New value>/usr/lib/jvm/java-6-sun/bin/java
Network access mode (ALL=allow any host, LOCAL=allow only this host, CUSTOM=list of hosts):
  Default>"LOCAL" (Press <ENTER> to accept the default value)
  New value>ALL
Security enabled. (true/false):
  Default>"FALSE" (Press <ENTER> to accept the default value)
  New value>

/opt/tptpAC/bin#

Agent Controller Server 를 실행합니다. (끄는건 ACStop.sh)

/opt/tptpAC/bin# ./ACStart.sh
Starting Agent Controller.
ACServer started successfully.


Checking Agent Controller Installation

한번 테스트 해봅시다.

/opt/tptpAC/bin# ./SampleClient

Connected to the Agent Controller on "localhost" at port number 10006

The Time Collector Agent ID: 103

Established a data channel with the agent.

Sending 5 Hello messages over data channel to TimeCollector ...

Start the TimeCollector ...

Incoming data: Hello from Time Collector Agent - Count 0
Incoming data: Hello from Time Collector Agent - Count 1
Incoming data: Hello from Time Collector Agent - Count 2
Incoming data: Hello from Time Collector Agent - Count 3
Incoming data: Hello from Time Collector Agent - Count 4
Incoming data: Hello from Time Collector Agent - Count 5

Stop the TimeCollector ...

Incoming data: Hello from Time Collector Agent - Count 6
Incoming data: Hello from Time Collector Agent - Count 7
Incoming data: Hello from Time Collector Agent - Count 8
Incoming data: Hello from Time Collector Agent - Count 9

All finished
Press enter key to exit...

/opt/tptpAC/bin#

포트가 열려 있는지 확인 해봅시다.

# netstat -n -a | grep 10002
tcp6       0      0 :::10002                :::*                    LISTEN
tcp6       0      0 ***.***.***.***:10002       ***.***.***.***:50412       ESTABLISHED

# netstat -n -a | grep 10005
tcp6       0      0 :::10005                :::*                    LISTEN

# netstat -n -a | grep 10006
tcp6       0      0 :::10006                :::*                    LISTEN
tcp6       0      0 ***.***.***.***:10006       ***.***.***.***:50414       ESTABLISHED



Profiling a Java Application

이제 톰켓을 프로파일링 모드로 구동시켜 봅시다.

시작 스크립트 부분에 아래와 같이 환경변수를 세팅해 줍니다.

# 임시 디렉토리 설정(옵션)
export TEMP="/tmp"
export TMP="/tmp"

export TPTP_AC_HOME="/opt/tptpAC"
export JAVA_PROFILER_HOME="${TPTP_AC_HOME}/plugins/org.eclipse.tptp.javaprofiler"
export PATH="${JAVA_PROFILER_HOME}:${TPTP_AC_HOME}/bin:${PATH}"
export LD_LIBRARY_PATH="${JAVA_PROFILER_HOME}:${TPTP_AC_HOME}/lib:${LD_LIBRARY_PATH}"

그리고 자바 옵션에 아래와 같이 추가합니다.

프로파일링의 종류는 3가지가 있습니다.

- CGProf : Execution time analysis.
- HeapProf : Object allocation/heap analysis.
- Thread : Thread analysis.

-agentlib:JPIBootLoader=JPIAgent:server=controlled;CGProf

저의 구동 스크립트는 CATALINA_OPTS 변수를 사용하더군요 ㅎㅎ

export CATALINA_OPTS="$CATALINA_OPTS -agentlib:JPIBootLoader=JPIAgent:server=enabled;HeapProf"

※ 만약 JPIAgent 를 찾을 수 없다거나 에러가 난다면 앞뒤로 '(쿼터)를 추가해 봅시다.

OS 종류에 따라 좀 틀려서.. ㅠ_ㅠ

export CATALINA_OPTS="$CATALINA_OPTS '-agentlib:JPIBootLoader=JPIAgent:server=enabled;HeapProf'"

옵션이 제대로 박혀 들어가 있는지도 확인 해봅시다.

# ps -ef | grep tomcat6
tomcat6   5899     1  2 20:12 ?        00:01:15 /usr/lib/jvm/java-6-sun/bin/java -Djava.util.logging.config.file=/var/lib/tomcat6/conf/logging.properties -Djava.awt.headless=true -Xmx128m -XX:+UseConcMarkSweepGC -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Xms256m -Xmx512m -agentlib:JPIBootLoader=JPIAgent:server=enabled;HeapProf -Djava.endorsed.dirs=/usr/share/tomcat6/endorsed -classpath /usr/share/tomcat6/bin/bootstrap.jar -Dcatalina.base=/var/lib/tomcat6 -Dcatalina.home=/usr/share/tomcat6 -Djava.io.tmpdir=/tmp/tomcat6-tmp org.apache.catalina.startup.Bootstrap start



이제 이클립스에서 원격으로 붙어서 상태를 확인 해봅시다.

물론 TPTP 플러그인은 깔려 있어야 합니다. ^^;;

Run - Profile Configurations...



Attach to Agent 를 추가하고 원격으로 볼 주소를 Default Hosts 에 추가합니다.



Agents 탭에 보면 떠있는 프로파일링이 보입니다. (바로 안보이면 Refresh 버튼 한번 클릭!)

선택 후 "Profile" 버튼을 클릭합니다.



"Profiling and Logging" 퍼스펙티브로 이동해서 보면 "Profiling Monitor" 탭에 등록한 호스트가 보일겁니다.

더블클릭해서 보면 프로파일링 결과가 나옵니다. ㅎㅎ




생각보다는 어렵지 않네요...

반응형
저작자표시
  • 카카오스토리
  • 트위터
  • 페이스북

'Tools > Eclipse' 카테고리의 다른 글

Eclipse JVM 경로 지정하기  (0) 2016.09.13
Eclipse + SVN Plugin  (1) 2012.03.29
Maven Integration for Eclipse  (0) 2012.02.20
Eclipse + TPTP (Eclipse Test & Performance Tools Platform)  (4) 2012.01.01
Eclipse + MyBatis Generator  (1) 2011.07.04
installation Oracle Enterprise Pack for Eclipse  (2) 2011.05.22
Eclipse + STS (SpringSource Tool Suite)  (1) 2011.01.16
Eclipse Plugins for JBoss technology  (1) 2011.01.11
Properties Editor  (1) 2009.11.17
UTF-8 설정  (0) 2009.11.16
    'Tools/Eclipse' 카테고리의 다른 글
    • Eclipse + SVN Plugin
    • Maven Integration for Eclipse
    • Eclipse + TPTP (Eclipse Test & Performance Tools Platform)
    • Eclipse + MyBatis Generator
    agent controller, Eclipse, profiling, remote, TPTP, tptpac
    Antop
    Antop
    뇌에서 블로그로... antop@naver.com
    댓글쓰기
    Maven Integration for Eclipse
    다음 글
    Maven Integration for Eclipse
    Eclipse + TPTP (Eclipse Test & Performance Tools Platform)
    이전 글
    Eclipse + TPTP (Eclipse Test & Performance Tools Platform)

    티스토리툴바