51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

查看: 4157|回复: 6

[资料] YourKit Java Profiler 剖析远程服务器

[复制链接]
  • TA的每日心情
    奋斗
    2022-5-8 19:23
  • 签到天数: 137 天

    连续签到: 1 天

    [LV.7]测试师长

    发表于 2011-11-29 20:15:26 | 显示全部楼层 |阅读模式

    YourKit Java Profiler 比 JProfiler 要好安装,特别是在剖析远程服务器上。先到
    YourKit.Java.Profiler.v9.0.3.For.Windows.Linux
    下载 windows 和 linux 版。

    把都解压到不同的目录如 D:\profile\YourKit.Java.Profiler.v9.0.3.Incl.Keygen.and 和
    D:\profile\YourKit.Java.Profiler.v9.0.3.Linux.Incl.Keygen.and。

    1、解压出 yjp-9.0.3.exe 安装。完了后,双击 D:\profile\YourKit.Java.Profiler.v9.0.3.Incl.Keygen.and\iNViSiBLE\keygen.bat 然后点“patch”,然后选择 D:\Program Files\YourKit Java Profiler 9.0.3\lib\yjp.jar

    2、输入用户名,点“Gengerate”,复制出 key。

    3、运行 yourkit profiler,输入刚才复制出的 key 就好了。

    然后就可正常运行了。

    回复

    使用道具 举报

  • TA的每日心情
    奋斗
    2022-5-8 19:23
  • 签到天数: 137 天

    连续签到: 1 天

    [LV.7]测试师长

     楼主| 发表于 2011-11-29 20:16:09 | 显示全部楼层

    剖析远程服务器还需要在 linux 的安装 yourkit profiler(以控制台行动不需要 License),把解压出来的 yjp-9.0.3-linux.tar.bz2 上传到服务器,如:/home/admin/yjp-9.0.3-linux.tar.bz2

    1、在 linux 解压 yjp-9.0.3-linux.tar.bz2,并运行。


    • cd /home/admin/  
    • tar xfj yjp-9.0.3-linux.tar.bz2  
    • cd yjp-9.0.3  
    • #生成启动脚本
    • java -jar lib/yjp.jar -integrate  

    在生成启动脚本期间,要选择。如下:


    • [admin@v022185 ~/yjp-9.0.3]$ java -jar lib/yjp.jar -integrate  
    • Choose server to integrate with:  
    • 1) Geronimo  
    • 2) JBoss 2.x/3.x/4.x  
    • 3) Jetty HTTP Server 5.x  
    • 4) JRun 4  
    • 5) Orion Application Server 1.5.x/2.x  
    • 6) Resin 2.x/3.x  
    • 7) Sun Application Server / GlassFish  
    • 8) Tomcat 3/4/5/6  
    • 9) WebLogic 9/10  
    • 10) WebSphere Application Server 7  
    • 11) Generic server (use if your server is not on the list)  
    • Enter number which corresponds to your server (0 to exit) and press Enter:  
    • >2  
    • Please specify whether the server runs on a 32-bit JVM or a 64-bit JVM.  
    • Hint: If you are not sure what to choose, choose "32-bit JVM". If with this choice the server does not start with profiling, re-run the integration and choose "64-bit Java" option.  
    • 1) 32-bit JVM  
    • 2) 64-bit JVM  
    • >2  
    • Location of JBoss startup script (<JBOSS_HOME>/bin/run.sh):  
    • >/home/admin/yjp-9.0.3/jboss_run.sh  
    • Startup options configuration: step 1 of 5  
    • Should option 'disablestacktelemetry' be specified?  
    • 1) Yes (recommended to minimize profiling overhead in production)  
    • 2) No  
    • >1  
    • Startup options configuration: step 2 of 5  
    • Should option 'disableexceptiontelemetry' be specified?  
    • 1) Yes (recommended to minimize profiling overhead in production)  
    • 2) No  
    • >1  
    • Startup options configuration: step 3 of 5  
    • Should option 'builtinprobes=none' be specified?  
    • 1) Yes (recommended to minimize profiling overhead in production)  
    • 2) No  
    • >1  
    • Startup options configuration: step 4 of 5  
    • Should option 'delay=10000' be specified?  
    • 1) Yes (recommended)  
    • 2) No  
    • >1  
    • Startup options configuration: step 5 of 5  
    • Please specify comma-separated list of additional startup options, or press Enter for no additional options:  
    • >  
    • Startup script to be used for profiling has been successfully created:  
    • /home/admin/yjp-9.0.3/jboss_run_with_yjp.sh  

    其实就在 jboss_run_with_yjp.sh 加个 jvm 启动参数:


    • -agentpath:/home/admin/yjp-9.0.3/bin/linux-x86-64/libyjpagent.so=disablestacktelemetry,disableexceptiontelemetry,builtinprobes=none,delay=10000,sessionname=JBoss  

    可以参数自己的环境手动写,sessionname 是随便写吧(没验证过)。

    用带 yjp 参数启动 jboss。就可以剖析远程服务器。

    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    奋斗
    2022-5-8 19:23
  • 签到天数: 137 天

    连续签到: 1 天

    [LV.7]测试师长

     楼主| 发表于 2011-11-29 20:16:22 | 显示全部楼层
    在本地机 windows 用界面观察。在欢迎界面中有个 “Connect to remote application ...” 链接。可以输入 host:post。

    注意 yourkit 的是在 10001 - 10010 中按顺序来决定哪个端口使用(有点不理解为什么不在启动 jvm 参数中指定)。

    比如:192.168.1.100:10001。然后就可以看到界面了:
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    奋斗
    2022-5-8 19:23
  • 签到天数: 137 天

    连续签到: 1 天

    [LV.7]测试师长

     楼主| 发表于 2011-11-29 20:16:38 | 显示全部楼层
    本帖最后由 msnshow 于 2011-11-29 20:19 编辑

    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有帐号?(注-册)加入51Testing

    x
    回复 支持 反对

    使用道具 举报

    该用户从未签到

    发表于 2011-11-30 20:20:48 | 显示全部楼层
    看上去不错,楼主还有相关文档共享一下么
    回复 支持 反对

    使用道具 举报

    该用户从未签到

    发表于 2014-6-11 11:11:38 | 显示全部楼层
    YourKit 这个工具性能具体分析,或者说怎么根据这个工具分析一个应用,怎么优化应用?

    方便的话能加一下您QQ么?
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    奋斗
    2022-5-8 19:23
  • 签到天数: 137 天

    连续签到: 1 天

    [LV.7]测试师长

     楼主| 发表于 2014-7-13 09:29:28 | 显示全部楼层
    主要还是看内存占用、回收是否正常
    回复 支持 反对

    使用道具 举报

    本版积分规则

    关闭

    站长推荐上一条 /1 下一条

    小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

    GMT+8, 2024-3-29 10:01 , Processed in 0.076200 second(s), 28 queries .

    Powered by Discuz! X3.2

    © 2001-2024 Comsenz Inc.

    快速回复 返回顶部 返回列表