缓存穿透
缓存穿透:大量请求无法命中缓存,直接走数据库,会使数据库压力瞬间增大,导致宕机。

缓存雪崩
缓存雪崩:当redis宕机,在高并发时,所有的请求全部涌入数据库,导致数据库宕机。
缓存雪崩的解决方案:
- 事前:redis高可用,主从+哨兵,redis cluster,避免全盘崩溃。
- 事中:本地ehcache缓存+hystrix限流&降级,避免Mysql被打死。
- 事后:redis持久化,快速恢复缓存数据。


缓存穿透:大量请求无法命中缓存,直接走数据库,会使数据库压力瞬间增大,导致宕机。
缓存雪崩:当redis宕机,在高并发时,所有的请求全部涌入数据库,导致数据库宕机。
缓存雪崩的解决方案:
本文标题:redis 缓存穿透&缓存雪崩
本文链接:https://www.haomeiwen.com/subject/euromqtx.html
网友评论