Strips ideas recorded once redis cpu abnormally elevated

Long time no write blog now dusted problems encountered in the work to facilitate future record encountered similar problems also have a reference.

 

Background: One day production server redis cpu cpu so frequent alarm mononuclear think it is not the volume of business will come up. After determining the problem is not found.

Troubleshooting ideas:

1. 查看监控cpu 最近三天 七天的历史状态 发现cpu目前是异常状态,比往常要高很多

2. 查看慢日志 发现有get app_encrypted:crawler_task_switch 获取某个key 用了40ms

3. monitor 监控当前命令使用状态 收集1分钟

 redis-cli -h ***** -a **** monitor > monitor.txt

4. 查看top command 发现get是最频繁的   

  取关键字GET的进行分析,统计key的get次数:   

  awk '/GET/{a[$5]++}END{for(i in a)print i"\t"a[i]}' monitor.txt |sort -k2nr|more

5. 发现排名第一的key是app_encrypted:crawler_task_switch 1分钟get 十几万次。


  问题找到,反应给开发 发现写了死循环 代码修改之后cpu恢复正常。

以上是问题排查及解决思路。 在这里记录不多 但是在排查过程中还是会遇到一些其他问题。

Guess you like

Origin www.cnblogs.com/soilge/p/11641456.html