当前位置:网站首页>Redis cache use case
Redis cache use case
2022-06-21 07:49:00 【Don't null a】
【1125】PH-UCP database CPU Utilization rate reaches 100%
1 Problem description ( Description of the incident , influence , Duration )
11 month 25 Japan ,PH-UCP database CPU Utilization rate reaches 100% It is arranged as follows :
13:50 Receive the O & M notification database CUP Utilization rate reaches 100%, Observe that the document composition is normal ;
2 Problem analysis ( Problem code or problem architecture positioning )
background : The current design ,PH-UCP Document template caching task , At the same time , Initiate Database Paging queries on multiple servers , To the database CPU Cause continuous high impact .
3 Problem handling ( How to deal with the problem )
Optimize document template caching task , Realize peak shifting access to database , And reduce the frequency of database access , This reduces the risk to the database CPU The impact of .
4 Problem deployment ( How to prevent 、 Whether to troubleshoot similar problems 、 Good advice, etc )
The precautions are as follows :
Daily check server and database indicators , If there is any abnormality, check it in time
Batch concurrent access to data , Try to achieve peak shift access
private void syncUcpDocCache() {
JedisCluster jedisCluster = RedisUtil.getJedisCluster();
String publicedCount = jedisCluster.get(RedisKeyConstants.REDIS_KEY_UCP_DOC_PUBLICED_COUNT);
LOGGER.info("PH-UCP-CORE Start loading cache ,isExe:{},ucpInfoEnable:{},newModeFlag:{},"+RedisKeyConstants.REDIS_KEY_UCP_DOC_PUBLICED_COUNT+
":{} >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",isExe, ucpInfoEnable, newModeFlag, publicedCount);
int time = (20*12*delayTime/1000)-10;
if(isExe && (ucpInfoEnable|| isPubliced(publicedCount))){
long count = RedisUtil.getJedisCluster().incr(PH_UCP_DOC_EXE_COUNT);
LOGGER.info(" Document cache initial count value :{}",count);
try {
if(count == 1){
jedisCluster.expire(PH_UCP_DOC_EXE_COUNT,time);
}
Thread.sleep(count*delayTime);
iUcpDocVerCacheService.sync();
} catch (Exception e) {
LOGGER.error(DictConstants.EXCEPTION_MSG, e);
jedisCluster.set(PH_UCP_DOC_PUBLICED_DEAL_FLAG,"F");
jedisCluster.expire(PH_UCP_DOC_PUBLICED_DEAL_FLAG,time);
}finally {
//JedisCluster jedisCluster = RedisUtil.getJedisCluster();
long count = jedisCluster.decr(PH_UCP_DOC_EXE_COUNT);
LOGGER.info(" The document cache finally count value :{}",count);
if(count == 0){
if(StringUtils.isEmpty(jedisCluster.get(PH_UCP_DOC_PUBLICED_DEAL_FLAG))){
long pubCount = RedisUtil.getJedisCluster().decr(RedisKeyConstants.REDIS_KEY_UCP_DOC_PUBLICED_COUNT);
if(pubCount<0){
jedisCluster.del(RedisKeyConstants.REDIS_KEY_UCP_DOC_PUBLICED_COUNT);
}
}else {
jedisCluster.del(PH_UCP_DOC_PUBLICED_DEAL_FLAG);
}
}else if(count < 0 ){
jedisCluster.del(PH_UCP_DOC_EXE_COUNT);
}else{
LOGGER.info(" The machine document cache has not been processed yet ");
}
}
}
LOGGER.info("PH-UCP-CORE End loading cache >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
}
边栏推荐
- 2021-07-28 STM32F103配置信息
- The reality camera in unity operates the mirror and lookat to the front of the object based on dotween
- . Net 4.5 asynchronous programming pilot (async and await)
- Pat class B 1031 checking ID card (15 points)
- 如何让mysql不区分大小写
- Seat number of Pat grade B 1041 test (15 points)
- A shell script to realize automatic expiration of Prometheus push gateway indicators
- Golang Sync. Use and principle of waitgroup
- 2021-07-28 STM32F103 I2C Hardware Transfer Include previous IO Clock EXIT USB use firmware library
- mysql分页查询如何优化
猜你喜欢

Dynamic programming to solve the problem of looting

Rdkit | molecular similarity based on molecular fingerprint
![[visualization - source code reading] antvis / g-base interpretation - 1](/img/a6/411621e180fa717f98136ddfdbe673.jpg)
[visualization - source code reading] antvis / g-base interpretation - 1

mysql存储过程中的循环语句怎么写

2021-06-16 STM32F103 EXTI 中斷識別 使用固件庫

MATLAB 三维图(非常规)

2021-07-28 STM32F103 I2C Hardware Transfer Include previous IO Clock EXIT USB use firmware library

虚拟机浏览器花屏空白问题

Definition and declaration problems in stm32

mysql数据库拉链表是什么
随机推荐
2021-06-18 STM32F103 DMA and DMA serial port code using firmware library
32 single chip microcomputer - PWM wave output
Learning Tai Chi maker esp8226 (IX) JSON data communication III
2022年的WordPress网站安全问题
Mingming has just changed his profession and won five offers as soon as he graduated
Asp. Net web API 2 Lesson 1 - getting started
How to view the MySQL installation path
Upgrade Jenkins steps and problems encountered
Research Report on market supply and demand and strategy of oil-free scroll compressor industry in China
[visualization - source code reading] antvis / g-base interpretation - 1
Rdkit | synthetic feasibility score --sa score
How to optimize MySQL paging query
A table to easily understand the prefix and suffix of increment and decrement operators
如何使用lerna进行多包(package)管理
文件下载 二进制流的形式构造url和base64下载
Matlab 3D diagram (unconventional)
JVM内存模型概念
Why is there no error in the code, but the data in the database cannot be displayed
Sword finger offer 34 A path with a value in a binary tree
24 parameter estimation interval estimation of two population parameters