We have problems in time of cache reloading. Currently we are flushing caches on the beging of reloading cache process and all request in that time are trying to get information directly from db and put in cache. As result we have we have CPU usege spyke in this period, and redis overloading.
There are few problematic areas:
CacheReloadResource.reloadAllPromotionCaches public ManagementResponseDO reloadAllPromotionCaches(@RequestHeader Map<String, String> headers)
throws Exception {
log.info("START:: CacheManagerResource : reloadAllPromotionCaches");
headerValidator.validateHeaders(headers);
ManagementResponseDO responseDO = refreshCache(() -> {
cacheProvider.flushCaches();
promotionCacheDataRefreshManager.refreshPromotionCacheData();
});
log.info("END:: CacheManagerResource : reloadAllPromotionCaches");
return responseDO;
}