Redis - (error) OOM command not allowed when used memory > 'maxmemory'

4,095 views
Skip to first unread message

ran mizrachi

unread,
Aug 25, 2013, 11:13:11 AM8/25/13
to redi...@googlegroups.com

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 command returns : used_memory_human:809.22M

If maxmemory is set to 500M, how did I reached 809M ?
Info command does not show any Keyspaces , how is it possible ?
keys * returns "(empty list or set)" ,I've tried to change db number , still no keys found.

Here is info command output:

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

I am lost, please help !
Thanks.

Yiftach Shoolman

unread,
Aug 26, 2013, 4:24:59 AM8/26/13
to redi...@googlegroups.com
Ran,

Can you send the output of 'info all'


--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+u...@googlegroups.com.
To post to this group, send email to redi...@googlegroups.com.
Visit this group at http://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/groups/opt_out.



--

Yiftach Shoolman
+972-54-7634621

ran mizrachi

unread,
Aug 26, 2013, 4:57:22 AM8/26/13
to redi...@googlegroups.com
redis 127.0.0.1:6380> info all

# 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:1557219
uptime_in_days:18
lru_clock:1435830

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

# Memory
used_memory:848530464
used_memory_human:809.22M
used_memory_rss:863551488
used_memory_peak:848529624
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:5
total_commands_processed:12
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:19373.24
used_cpu_user:1435756.50
used_cpu_sys_children:0.00
used_cpu_user_children:0.00

# Commandstats
cmdstat_select:calls=3,usec=71,usec_per_call=23.67
cmdstat_keys:calls=3,usec=94,usec_per_call=31.33
cmdstat_info:calls=6,usec=459657,usec_per_call=76609.50

# Keyspace

Thanks,
Ran.

Yiftach Shoolman

unread,
Aug 26, 2013, 7:20:11 AM8/26/13
to redi...@googlegroups.com
Hi Ran,

Before diving into this (there could be multiple scenarios), can u please upgrade to 2.6.15 and retry. 

The Baldguy

unread,
Aug 27, 2013, 1:39:41 AM8/27/13
to redi...@googlegroups.com
According to the command stats section, you've only issued a few calls, none of which load data.

Possible scenarios:

1. Your data set was loaded from a snapshot or AOF file, which consumed more memory than allowed in the process of replaying. I'm not sure if the memory limits apply during data load or replay and am not in a place I can check that right now.

2. I see some select calls in the command stats. Have you checked to ensure you are selecting the same db? The default is 0 and no select calls are made by the cli tool without it being told to, so perhaps your code is selecting a database you aren't looking at by using the default (or vice versa). Again, I don't recall if the stats output for different DBs are reported in each db. It kinda makes sense it would be different, so it might be worth looking into the selects.

If you could strip out the comments from your config, and perhaps show the code as well we could be of more assistance.

Cheers

Matt Palmer

unread,
Aug 27, 2013, 3:02:32 AM8/27/13
to redi...@googlegroups.com
On Mon, Aug 26, 2013 at 10:39:41PM -0700, The Baldguy wrote:
> 1. Your data set was loaded from a snapshot or AOF file, which consumed
> more memory than allowed in the process of replaying. I'm not sure if the
> memory limits apply during data load or replay and am not in a place I can
> check that right now.

They don't, at least for RDB loads (I'm not as familiar with the AOF data
loading code).

> 2. I see some select calls in the command stats. Have you checked to
> ensure you are selecting the same db? The default is 0 and no select
> calls are made by the cli tool without it being told to, so perhaps your
> code is selecting a database you aren't looking at by using the default
> (or vice versa). Again, I don't recall if the stats output for different
> DBs are reported in each db. It kinda makes sense it would be different,
> so it might be worth looking into the selects.

The counts for all databases are provided in the 'keyspace' section; there
isn't a lot of data in the whole datastore (at least in number of keys).

- Matt

Manel García

unread,
Sep 4, 2017, 6:01:32 AM9/4/17
to Redis DB
Probably swap

El diumenge, 25 agost de 2013 17:13:11 UTC+2, ran mizrachi va escriure:
Reply all
Reply to author
Forward
0 new messages