1.告警发生时间:2013-04-13 17:10:00
告警内容:10.190.235.195 内存swap_in持续高 当前值:107 阀值:50
告警发生时间:2013-04-06 22:55:00
告警内容:10.190.235.195 内存swap_in持续高 当前值:489 阀值:50
最近一次重启时间为2013-01-07 11:45
有三个月零9天没有重启了,看到在线人数统计似乎有异常,临晨也有100多人,不大合理,重启。
内存不足告警 |
分析swap_in和swap_out,有一个指标超过20,并且持续15分钟触发告警。 只有当swap_in和swap_out的值为0时,才判断为告警恢复 |
机器内存不够用。请查看是否有进程存在内存泄漏,或者内存使用不当。 您可能需要了解如何查看单个进程占用的内存大小? |
1. 如何查看单个进程占用的内存大小?
可以使用top -p PID,pmap -x PID,ps aux|grep PID命令,也可以通过/proc/$process_id(进程的PID)/status文件查看,例如/proc/7159/status文件。
2. 如何查看服务器内存使用率?
可以通过free,top(执行后可通过shitf+m对内存排序),vmstat,procinfo命令,也可以通过/proc/meminfo文件查看.
以上,第一个为session,第二个位island,第三个为gate,第五个为platform,发现在17:03分有redis读的异常抛出
session 2013-04-13 17:02:50,987 ERROR:(main) com.ztgame.rabbit.server.session.SessionServerService - save game time failed: com.ztgame.tiger.framework.core.ServiceException: redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketTimeoutException: Read timed out at com.ztgame.tiger.framework.dal.CacheManager.setGameTime(CacheManager.java:542) at com.ztgame.rabbit.server.session.SessionServerService.saveGameTime(SessionServerService.java:85) at com.ztgame.rabbit.server.session.SessionServerService.access$000(SessionServerService.java:22) at com.ztgame.rabbit.server.session.SessionServerService$1.onTick(SessionServerService.java:150) at com.ztgame.tiger.framework.timer.TimerManager.tick(TimerManager.java:58) at com.ztgame.tiger.framework.core.MainLoop.tick(MainLoop.java:80) at com.ztgame.tiger.framework.core.MainLoop.run(MainLoop.java:89) at com.ztgame.rabbit.server.session.SessionServerService.onRun(SessionServerService.java:172) at com.ztgame.tiger.framework.core.AbstractService.start(AbstractService.java:83) at com.ztgame.rabbit.server.session.SessionServer.main(SessionServer.java:20) Caused by: redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketTimeoutException: Read timed out at redis.clients.jedis.Protocol.process(Unknown Source) at redis.clients.jedis.Protocol.read(Unknown Source) at redis.clients.jedis.Connection.getStatusCodeReply(Unknown Source) at redis.clients.jedis.Jedis.set(Unknown Source) at com.ztgame.tiger.framework.dal.CacheManager.setGameTime(CacheManager.java:537) ... 9 more island 2013-04-13 17:03:09,791 ERROR:(save to db) com.ztgame.rabbit.server.island.service.role.RoleManager - saveData failed: 792533 com.ztgame.tiger.framework.core.ServiceException: redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketTimeoutException: Read timed out at com.ztgame.tiger.framework.dal.CacheManager.updateRole(CacheManager.java:261) at com.ztgame.tiger.framework.dal.GameRepository.save(GameRepository.java:1482) at com.ztgame.rabbit.server.island.service.role.RoleManager.saveData(RoleManager.java:191) at com.ztgame.rabbit.server.island.service.role.RoleManager$SaveDataThread.run(RoleManager.java:106) at java.lang.Thread.run(Thread.java:662) Caused by: redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketTimeoutException: Read timed out at redis.clients.jedis.Protocol.process(Unknown Source) at redis.clients.jedis.Protocol.read(Unknown Source) at redis.clients.jedis.Connection.getStatusCodeReply(Unknown Source) at redis.clients.jedis.Jedis.set(Unknown Source) at com.ztgame.tiger.framework.dal.CacheManager.updateRole(CacheManager.java:255) ... 4 more Caused by: java.net.SocketTimeoutException: Read timed out at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.read(SocketInputStream.java:129) at java.net.SocketInputStream.read(SocketInputStream.java:90) at redis.clients.util.RedisInputStream.fill(Unknown Source) at redis.clients.util.RedisInputStream.readByte(Unknown Source) ... 9 more ===============================
2.最好所有JAVA应用的Xmx相加小于系统内存!