Home > Database > Redis > How much data can redis cache at most?

How much data can redis cache at most?

anonymity
Release: 2019-06-04 21:30:55
Original
6139 people have browsed it

Redis occupies an increasingly important position in distributed applications. With just tens of thousands of lines of code, a high-performance data storage service is implemented.

How much data can redis cache at most?

Check the redis source code and find that redis will time out under certain circumstances, as follows:

1. Network. Redis processing is closely related to the network. If the network is interrupted, redis timeout is likely to occur. If this situation occurs, you should first check the network bandwidth information of the redis machine to determine whether there is an interruption.

2. Memory. All redis data is stored in memory. When the physical memory is not enough, Linux OS will use swap memory, causing memory swapping. At this time, if there is a redis call command, a redis timeout will occur. Here you can adjust the /proc/sys/vm/swappiness parameter to set the amount of physical memory used before swapping.

Maximum cache setting

Example: maxmemory 100mb

Unit: mb, gb.

The default is 0, and the maximum cache is not specified. If new data is added and exceeds the maximum memory, redis will crash, so it needs to be set.

After setting maxmemory, the cache data recycling policy must be set accordingly.

The above is the detailed content of How much data can redis cache at most?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template