- One 、 operating system SWAP
- Two 、Redis Why does it trigger swap
- 3、 ... and 、 see Redis swap situation
- Four 、 solve Redis swap
One 、 operating system SWAP
swap It's the behavior of the operating system , When there is not enough memory , The operating system takes out part of the data in the memory and puts it on the disk , The mechanism of data swapping in and out from memory and disk , Disk related IO. Once occurred swap, The performance of processes corresponding to memory will be affected , Because the access speed of hard disk is far less than that of memory .
redis As in memory database , If redis The corresponding memory has changed swap, that redis The performance of will be greatly affected .
Two 、Redis Why does it trigger swap
Trigger swap The core reason is that the machine is out of memory , about redis There are two reasons to trigger swap：
- redis It takes up a lot of memory , This causes the machine to run out of available memory
- redis Memory occupied by other processes on the machine , Cause out of memory .
3、 ... and 、 see Redis swap situation
lookup redis The corresponding process id
src/redis-cli info | grep process_id
本文为[Program ape Owen]所创，转载请带上原文链接，感谢