jconsole观察分析Java程序的运行,进行排错调优

jsconsole非受权远程链接java

-Djava.rmi.server.hostname=172.16.10.218 -Dcom.sun.management.jmxremote.port=8999 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false

linux运行定时任务程序 报错以下:linux

Exception thrown by the agent : java.net.MalformedURLException: Local host name unknown: java.net.UnknownHostException: =mail.06taobao.com数据库

解决:hostname =wangfw-smarttrip-dev-8.novalocal 没有对应一个ip地址,在/etc/hosts中添加127.0.0.1 =wangfw-smarttrip-dev-8.novalocal架构

受权链接能够看看这篇文章:jvm

http://www.linuxidc.com/Linux/2015-02/113420.htm

性能分析socket

下面说说如何分析,如何使用这六个标签性能

概述: Displays overview information about the Java VM and monitored values.测试

内存: 显示内存使用信息优化

线程: 显示线程使用信息.net

类: 显示类装载信息

*VM摘要:*显示java VM信息

MBeans: 显示 MBeans.

以上这些介绍你们能够看下这篇博客详细介绍

http://jiajun.iteye.com/blog/810150

这里主要讲解下根据jsconsole线程提供的堆栈信息检查判断性能瓶颈

背景以下:

这里两天作下单的性能测试发现,在优化Thrfit接口参数以及调优了jvm参数以后,最好的tps就是在80左右,没法再往上提高了;

Thrift 默认socket链接轮休线程数,以及逻辑处理线程数,因此有时候仍是须要改下对应的默认参数的,咱们项目组优化了这两个参数以后,tps直接翻倍

/** The number of threads for selecting on already-accepted connections */
    public int selectorThreads = 2;
    /**
     * The size of the executor service (if none is specified) that will handle
     * invocations. This may be set to 0, in which case invocations will be
     * handled directly on the selector threads (as is in TNonblockingServer)
     */
    private int workerThreads = 5;

如下为线程堆栈信息,下面对应指向了交易的代码;review此处代码发现,这个地方存在数据库锁,因此无论优化哪里,此处都会存在竞争关系,因此必须等待,这也就是为何tps上不去的缘由;

输入图片说明

// 商品已售数量增长减操做;
		int effectRow = goodModuleDao.updateGoodsBuyRuleHadSaleNumForPackage(packageGoods.getGoodsPackageBuyRule()
				.getId(), voucher.getMaxUseNumber());
		if (effectRow != 1) {
			logger.error("商品库存不足 voucherData" + voucherData);
			throw new BussinessExceptionNeedCatch(OrderModuleErrorCode.GOODS_STOCK_FINISH_ERROR);
		}

针对扣减库存的方式,此处因为与业务逻辑绑定在一块儿的,因此从整个架构来讲是暂时无法修改的;必须从总体规划来解决此问题,已提供更高的吞吐量;

分享下一些服务化处理方法: 输入图片说明

相关文章
相关标签/搜索