redis限制注意点

仓廪实则知礼节,衣食足则知荣辱。这篇文章主要讲述redis限制注意点相关的知识,希望能为你提供帮助。
使用CONFIG SET timeout 控制客户端连接超时
对于客户端的连接输出量有限制
There are two kind of limits Redis uses:
The hard limit is a fixed limit that when reached will make Redis closing the client connection as soon as possible.
The soft limit instead is a limit that depends on the time, for instance a soft limit of 32 megabytes per 10 seconds means that if the client has an output buffer bigger than 32 megabytes for, continuously, 10 seconds, the connection gets closed.
Different kind of clients have different default limits:
Normal clients have a default limit of 0, that means, no limit at all, because most normal clients use blocking implementations sending a single command and waiting for the reply to be completely read before sending the next command, so it is always not desirable to close the connection in case of a normal client.
Pub/Sub clients have a default hard limit of 32 megabytes and a soft limit of 8 megabytes per 60 seconds.
Slaves have a default hard limit of 256 megabytes and a soft limit of 64 megabyte per 60 second.
It is possible to change the limit at runtime using the CONFIG SET command or in a permanent way using the Redis configuration file redis.conf. See the example redis.conf in the Redis distribution for more information about how to set the limit.
查询buffer也有限制,最大1GB
安装的时候要设置swap
Make sure to setup some swap in your system (we suggest as much as swap as memory). If Linux does not have swap and your Redis instance accidentally consumes too much memory, either Redis will crash for out of memory or the Linux kernel OOM killer will kill the Redis process.
【redis限制注意点】

    推荐阅读