0

We are running redis on our production platform. Redis runs fine on it but every now and then it starts to build up memory and then will eventually crash out.

We cant seem to pinpoint what is happening. This happens once a week. During the rest of the week its running with max of 400mb memory.

Here is the redis-cli info all:

# Server
redis_version:2.8.4
redis_git_sha1:00000000
redis_git_dirty:0
redis_build_id:645b61b5aa39f6b1
redis_mode:standalone
os:Linux 3.13.0-170-generic x86_64
arch_bits:64
multiplexing_api:epoll
gcc_version:4.8.4
process_id:14311
run_id:ec45c8262378b81c977cd8ef1f1466872601a72b
tcp_port:6379
uptime_in_seconds:174217
uptime_in_days:2
hz:10
lru_clock:680264
config_file:/etc/redis/redis.conf

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

# Memory
used_memory:4516218008
used_memory_human:4.21G
used_memory_rss:4007305216
used_memory_peak:4522107864
used_memory_peak_human:4.21G
used_memory_lua:33792
mem_fragmentation_ratio:0.89
mem_allocator:jemalloc-3.5.1

# Persistence
loading:0
rdb_changes_since_last_save:3095
rdb_bgsave_in_progress:0
rdb_last_save_time:1558694950
rdb_last_bgsave_status:ok
rdb_last_bgsave_time_sec:9
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

# Replication
role:master
connected_slaves:0
master_repl_offset:0
repl_backlog_active:0
repl_backlog_size:1048576
repl_backlog_first_byte_offset:0
repl_backlog_histlen:0

# CPU
used_cpu_sys:1122.99
used_cpu_user:422.74
used_cpu_sys_children:20.35
used_cpu_user_children:162.11

# Commandstats
cmdstat_get:calls=11786294,usec=83965773,usec_per_call=7.12
cmdstat_set:calls=100000,usec=257525,usec_per_call=2.58
cmdstat_setex:calls=1462233,usec=90698334,usec_per_call=62.03
cmdstat_del:calls=16950,usec=105826,usec_per_call=6.24
cmdstat_lpush:calls=100000,usec=241470,usec_per_call=2.41
cmdstat_select:calls=1412415,usec=5822129,usec_per_call=4.12
cmdstat_keys:calls=1,usec=7307,usec_per_call=7307.00
cmdstat_dbsize:calls=2,usec=7,usec_per_call=3.50
cmdstat_info:calls=152,usec=18292,usec_per_call=120.34
cmdstat_monitor:calls=5,usec=18,usec_per_call=3.60
cmdstat_ttl:calls=3,usec=25,usec_per_call=8.33
cmdstat_config:calls=3,usec=69,usec_per_call=23.00
cmdstat_slowlog:calls=1,usec=7,usec_per_call=7.00

# Keyspace
db0:keys=24429,expires=24425,avg_ttl=37811496

We've read about solutions but dont want to implement because we are on the fence as to what to try first. When we clear out redis db when this is happening it starts to build up again.

Jack Kitley
  • 375
  • 1
  • 2
  • 16
  • What are you using Redis for exactly (application & use cases)? – Namoshek May 24 '19 at 11:04
  • @Namoshek Using it for sessions, page info cache(vehicles) for 1hr. Model schema for 24 hours. We cache settings. User roles. – Jack Kitley May 24 '19 at 11:11
  • You are not caching anything the user has direct impact on, like let's say API throttling info or other usage based things? If so, you should also see some spikes elsewhere (like CPU or database usage, ...). – Namoshek May 24 '19 at 12:54

0 Answers0