如何调试错误“使用内存时不允许OOM命令"'最大内存''在 Redis 中? [英] How to debug the error "OOM command not allowed when used memory > 'maxmemory'" in Redis?

查看:23
本文介绍了如何调试错误“使用内存时不允许OOM命令"'最大内存''在 Redis 中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在尝试设置密钥时收到不允许 OOM 命令",maxmemory 使用 maxmemory-policy "volatile-lru" 设置为 500M,我正在为发送到 redis 的每个密钥设置 TTL.

I'm getting "OOM command not allowed" when trying to set a key, maxmemory is set to 500M with maxmemory-policy "volatile-lru", I'm setting TTL for each key sent to redis.

INFO 命令返回:used_memory_human:809.22M

  1. 如果 maxmemory 设置为 500M,我是如何达到 809M 的?
  2. INFO 命令不显示任何键空间,这怎么可能?
  3. KEYS * 返回 "(empty list or set)" ,我尝试更改数据库编号,但仍然没有找到键.
  1. If maxmemory is set to 500M, how did I reached 809M ?
  2. INFO command does not show any Keyspaces , how is it possible ?
  3. KEYS * returns "(empty list or set)" ,I've tried to change db number , still no keys found.

这里是信息命令输出:

redis-cli -p 6380
redis 127.0.0.1:6380> info
# Server
redis_version:2.6.4
redis_git_sha1:00000000
redis_git_dirty:0
redis_mode:standalone
os:Linux 2.6.32-358.14.1.el6.x86_64 x86_64
arch_bits:64
multiplexing_api:epoll
gcc_version:4.4.7
process_id:28291
run_id:229a2ee688bdbf677eaed24620102e7060725350
tcp_port:6380
uptime_in_seconds:1492488
uptime_in_days:17
lru_clock:1429357

# Clients
connected_clients:1
client_longest_output_list:0
client_biggest_input_buf:0
blocked_clients:0

# Memory
used_memory:848529904
used_memory_human:809.22M
used_memory_rss:863551488
used_memory_peak:848529192
used_memory_peak_human:809.22M
used_memory_lua:31744
mem_fragmentation_ratio:1.02
mem_allocator:jemalloc-3.0.0

# Persistence
loading:0
rdb_changes_since_last_save:0
rdb_bgsave_in_progress:0
rdb_last_save_time:1375949883
rdb_last_bgsave_status:ok
rdb_last_bgsave_time_sec:-1
rdb_current_bgsave_time_sec:-1
aof_enabled:0
aof_rewrite_in_progress:0
aof_rewrite_scheduled:0
aof_last_rewrite_time_sec:-1
aof_current_rewrite_time_sec:-1
aof_last_bgrewrite_status:ok

# Stats
total_connections_received:3
total_commands_processed:8
instantaneous_ops_per_sec:0
rejected_connections:0
expired_keys:0
evicted_keys:0
keyspace_hits:0
keyspace_misses:0
pubsub_channels:0
pubsub_patterns:0
latest_fork_usec:0

# Replication
role:master
connected_slaves:0

# CPU
used_cpu_sys:18577.25
used_cpu_user:1376055.38
used_cpu_sys_children:0.00
used_cpu_user_children:0.00

# Keyspace
redis 127.0.0.1:6380>

推荐答案

是否有机会更改数据库的数量?如果使用非常大的数字,那么初始内存使用量可能会很高

Any chance you changed the number of databases? If you use a very large number then the initial memory usage may be high

这篇关于如何调试错误“使用内存时不允许OOM命令"'最大内存''在 Redis 中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆