=100"当前呼叫中心DB2数据库cfg配置信息如下(MAXLOCKS)=AUTOMATIC(98)(MAXAPPLS)=AUTOMATIC(147)修改DB2连接数db2updatedbcfgforsdnxcsrusingMAXAPPLS149查看DB2连接数db2listappl" />
当前位置:文档之家› was调优+was内存溢出解决办法

was调优+was内存溢出解决办法

座席系统应用故障问题分析如下

一、数据库配置信息
1、DB2数据库连接数计算规则 "maxappls * maxlocks >= 100"
当前呼叫中心DB2数据库cfg配置信息如下
(MAXLOCKS) = AUTOMATIC(98)
(MAXAPPLS) = AUTOMATIC(147)
修改DB2连接数 db2 update db cfg for sdnxcsr using MAXAPPLS 149
查看DB2连接数 db2 list applications
2、数据库APPLHEAPSZ
db2 get db cfg for sdnxcsr|grep "Default application heap"
Default application heap (4KB) (APPLHEAPSZ) = 4096
二、WAS连接池配置信息
WAS连接池配置信息如下
连接超时:180 秒
最大连接数:80
最小连接数:10
收集时间:180秒
未使用的超时:1800秒
时效超时:0秒
清除策略:整个池

三错误信息定位过程
1、查看分析以下日志信息
../profiles/Appsrv01/logs/server下主要日志:
SystemErr.log 系统出错日志
SystemOut.log 系统中所有活动的日志
trace.log 系统中所有跟踪的事件的日志
startServer.log 启动服务器事件的日志
stopServer.log 停止服务器事件的日志
native_stderr.log Gc垃圾收集日志
IBM Http Server(IHS)与Plugin日志信息: httpserver/../logs下相关日志如果有相关was抛错等首先查看以上日志文件。
2、5/30/13日志信息提示Not enough storage is available in the application heap to process the statement.. SQLCODE=-954, SQLSTATE=57011, DRIVER=3.62.56
意思是DB2的 堆(APPLHEAPSZ)大小不足、或表空间已满。查看数据库配置信息发现(APPLHEAPSZ) = 4096已经很大、表空间更不可能满(表空间有监控达到70%报警)
断定此报错信息属于表面现象。
3、初步分析可能是座席系统代码问题,数据库连接池或事物未提交导致堆内存满,但将座席系统代码全部检查,发现有2个Service调用数据库操作,但是未加入事物控制。
UserInfoServiceImpl.getCurrentUserInfo();
UserServiceImpl.resetPassword();

4、继续分析日志发现自5/29/13 20左右的时候也有类似信息,发现出现SQLCODE=-954, SQLSTATE=57011错误前系统已经有提示信息
[5/29/13 20:35:49:870 GMT+08:00] 0000002b FFDCJanitor I com.ibm.ws.ffdc.impl.FFDCJanitor doCleanupIfNeeded FFDCJANITOR_DELETED_FILES
[5/29/13 20:35:49:897 GMT+08:00] 0000002b FfdcProvider W com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: FFDC Incident emitted on /opt/IBM/WebSphere/AppServer/profiles/Custom01/logs/ffdc/csrserver21_33153315_13.05.29_20.35.49.88243535.txt com.ibm.ws.rsadapter.jdbc.WSJccPreparedStatement.pmiExecuteQuery 738
[5/29/13 20:35:49:929 GMT+08:00] 0000002b FfdcProvider W com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: FFDC Incident emitted on /opt/IBM/WebSphere/AppServer/profiles/Custom01/logs/ffdc/csrserver21_33153315_13.05.29_20.35.49.91143536.txt com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement.executeQuery 371
经分网上查找相关资料析发现com.ibm.ws.ffdc.impl.FFDCJanitor doCleanupIfNeede

d FFDCJANITOR_DELETED_FILES大多是由于连接池问题导致,印证了最初的判断,继续往这个方向努力
网上相关报错信息比较少,没有对此的深入分析
分析可能原因:有可能是连接池配置不合理,导致连接未释放
WAS7.0.0.17自身的JNDI连接池存在bug(网上有人说存在此问题需要打02补丁),分析可能性不大
was连接池配置不够用或DB2数据库连接数不够用
5、测试环境问题复现
同时3个用户并发访问系统,预期应该报错,测试结果确实是这样,查看日志发现出现com.ibm.ws.rsadapter.jdbc.WSJccPreparedStatement.pmiExecuteQuery 738
但是为出现 SQLCODE=-954, SQLSTATE=57011
继续分析:DB2数据库除了座席系统使用外 APP系统、批量系统均连接此数据库(连接池模式)。
想办法让问题重现。
(1)修改db2的最大连接数
修改db2 update db cfg for sdnxcsr using MAXAPPLS 10
(2)修改数据库APPLHEAPSZ
db2 update db cfg for sdnxcsr using APPLHEAPSZ 32
db2 get db cfg for sdnxcsr|grep "Default application heap"
Default application heap (4KB) (APPLHEAPSZ) = 32
(3)将Spring的部分事物控制注释
6、测试一段时间后故障现象重新。
7、代码检查发现问题
UserServiceImpl.resetPassword();
public void resetPassword(String userId, Integer expire)
throws BaseException {
try {
UserVO userVO = new UserVO();
userVO.setUserId(userId);
userVO = userDao.load(userVO);
userVO.setPassword(StringUtil
.encodeBySha(GlobalConstants.DEFAULT_PASSWORD));// 默认密码
userVO.setPwdReset(1);// 密码重置标志
userVO.setPwdUpdateBy(WebToolkitFilter.getCurrentUserInfo().getId());
Date now = DateUtil.getNowTime();
//重置密码失败次数为零
userVO.setAuthFailureCnt(0);
userVO.setPwdUpdateDate(now);// 修改日期
userVO.setPwdLastTerm(DateUtil.addDay(now, expire));// 密码有效日期
userDao.update(userVO);
https://www.doczj.com/doc/0b11621941.html,("密码重置成功!");
} catch (Exception e) {
e.printStackTrace();
logger.error("密码重置失败!");
throw new BaseException("密码重置失败!");
}
}

UserInfoServiceImpl.getCurrentUserInfo();
public OperatorDetails getCurrentUserInfo() throws BaseException {
try {
OperatorDetails operatorDetails = SpringSecurityUtils
.getCurrentUser();
//logger.error("#############当前登录人:"+operatorDetails.getId());
if (operatorDetails != null) {
DictDetailVO dictDetailVO = dictDetailDao
.load(new DictDetailVO() {
{
setDictTypeCode(GlobalConstants.DataDictTypes.DICT_COMPUTER_REF_PHONE);
setDictKey(WebToolkitFilter.getClientIP());
}
});

operatorDetails.put("belongCenter", belongCenter);

if (dictDetailVO != null) {
operatorDetails.put("ip", dictDetailVO.getDictKey());
operatorDetails.put("phoneNo",
dictDetailVO.getDic

tName());
}
operatorDetails.put("agentId", staffInfoVO.getAgentId());
operatorDetails.put("callerId", staffInfoVO.getCallerId());

operatorDetails.put("isSeat", "0");
if (staffInfoVO.getIsArrangeClass() != null) {
operatorDetails.put("isSeat",
staffInfoVO.getIsArrangeClass());
}

operatorDetails.put("sex", staffInfoVO.getSexType());
// 这里通过WebToolkit获取IP地址
staffInfoVO.setLoginHostIp(WebToolkitFilter.getClientIP());
staffInfoVO.setWorkStatus(GlobalConstants.WorkStatus.ONE);
staffInfoVO.setWorkStatusTime(DateUtil.getNowTime());
staffInfoDao.update(staffInfoVO);
}
}
}

相关主题
文本预览
相关文档 最新文档