您的位置:首页 > 其它

使用JProfiler排查远程应用性能问题

2016-12-14 15:18 302 查看
在很多情况下,我们需要使用windows上的Jprofiler客户端来检测linux服务器上web程序的性能,以下是安装与配置步骤。

一、安装与配置

1.Jprofiler下载

本文使用9.2版本。

Windows下下载地址 http://www.ej-technologies.com/

linux下下载: curl -O http://download-keycdn.ej-technologies.com/jprofiler/jprofiler_linux_9_2.sh

2.服务器端安装:

#本例中使用work用户

sudo su work

export JAVA_HOME=/data/work/soft/jdk1.7.0_51/

export INSTALL4J_JAVA_HOME=$JAVA_HOME

chown work jprofiler_linux_9_2.sh

chmod +x *.sh

./jprofiler_linux_9_2.sh -c

这里的 -c 意思是用字符方式来安装。根据提示来安装即可。安装路径建议设置在: /opt/jprofiler9,如果用默认安装,会安装在~/jprofiler9目录下

3.配置JProfiler生成脚本

在本机配置JProfiler生成startup_jprofiler.sh脚本,生成方式如下:

在windows中运行JProfiler,进入Session菜单,依次选择Integration Wizards–>New Server Integration,选择”Profile an application server, locally or 77 remotely”

1.选择tomcat 7

2.选择 “On a remote computer” , Linux X86/AMD64

3.选择Oracle –>1.7 –>hotspots

4.选择” Start Immediately, Connect later with the JProfiler GUI”

5.在选择机器上查看ip, ifconfig, 填入ip

6.远程服务器JProfiler的安装路径,默认在/opt/jprofiler9: 默认在~/jprofiler9

7.tomcat的startup.sh脚本,从远程服务器上把tomcat的bin目录下的startup.sh复制到本地,再选择本地的路径:

8.选择默认端口 8849

9. I will start the session later.

Finish后,会在Start Center显示刚创建的Session

4.上传脚本:

把生成的startup_jprofiler.sh(在选择的startup.sh目录中)文件上传到远程tomcat的bin目录下

chmod +x startup_jprofiler.sh(脚本赋写权限)

5.启动脚本:

./startup_jprofiler.sh,然后就可以在windows本地远程访问linux服务器上的jprofiler了

6.启动Session

初始化profiling设置,这里选择所有功能。

二、开启并Attach Session

进入Start Center(工具栏中第一个按钮),选择已配置好的Session配置,点击Start即可。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  性能 服务器