-
Notifications
You must be signed in to change notification settings - Fork 24.1k
Description
Hi everyone. I'm facing some issues to deal with the memory increase in Redis 5.0.9. Our setup consists of 3 VM's, master, slave, and a Sentinel.
Our application pipeline consists in:
XADD mystream * sensor-id 1234 temperature 19.8
We work with 12 different streams.
XREADGROUP GROUP mygroup Alice COUNT 150 STREAMS mystream >
XTRIM 500000 mystream
We understand that Redis does not release memory instantly using the XDEL command. So we changed to use XTRIM and evict OOM errors.
Analyzing our metrics, we detected a correlation between XREADGROUP commands and memory increase. Remembering that we perform an XTRIM command. But memory continues to increase.
Some data to help us discover what going on:
The slave node doesn't increase memory equal master node, our replication is working fine.
We are using Golang client with MinConnIdle config was set as 100 per host. (our default is 10 nodes).
Our number of consumers is about 10 per consumer node (about 6 nodes dedicated to consumers).
Looking for pending messages is zero. XLEN of our streams is equal to XTRIM value.
Our XADD rate is about 6k per second.
Redis INFO:
# Server
redis_version:5.0.9
redis_git_sha1:00000000
redis_git_dirty:0
redis_build_id:3d4d32bb8c35cf6a
redis_mode:standalone
os:Linux 4.1.12-61.1.28.el6uek.x86_64 x86_64
arch_bits:64
multiplexing_api:epoll
atomicvar_api:sync-builtin
gcc_version:4.4.7
process_id:26640
run_id:b50f2a78f33faa60d6d2cf48a6939aac075fcc34
tcp_port:6379
uptime_in_seconds:177932
uptime_in_days:2
hz:20
configured_hz:10
lru_clock:4794776
executable:/usr/local/redis/src/redis-server
config_file:/data/redis.conf
# Clients
connected_clients:2136
client_recent_max_input_buffer:4
client_recent_max_output_buffer:123072
blocked_clients:45
# Memory
used_memory:7442392864
used_memory_human:6.93G
used_memory_rss:7431725056
used_memory_rss_human:6.92G
used_memory_peak:7452463192
used_memory_peak_human:6.94G
used_memory_peak_perc:99.86%
used_memory_overhead:1114066798
used_memory_startup:783544
used_memory_dataset:6328326066
used_memory_dataset_perc:85.04%
allocator_allocated:7442401520
allocator_active:7460909056
allocator_resident:7569297408
total_system_memory:33461932032
total_system_memory_human:31.16G
used_memory_lua:37888
used_memory_lua_human:37.00K
used_memory_scripts:0
used_memory_scripts_human:0B
number_of_cached_scripts:0
maxmemory:25769803776
maxmemory_human:24.00G
maxmemory_policy:volatile-lru
allocator_frag_ratio:1.00
allocator_frag_bytes:18507536
allocator_rss_ratio:1.01
allocator_rss_bytes:108388352
rss_overhead_ratio:0.98
rss_overhead_bytes:-137572352
mem_fragmentation_ratio:1.00
mem_fragmentation_bytes:-10407736
mem_not_counted_for_evict:0
mem_replication_backlog:1073741824
mem_clients_slaves:16922
mem_clients_normal:39523900
mem_aof_buffer:0
mem_allocator:jemalloc-5.1.0
active_defrag_running:0
lazyfree_pending_objects:0
# Persistence
loading:0
rdb_changes_since_last_save:1112266617
rdb_bgsave_in_progress:0
rdb_last_save_time:1615229752
rdb_last_bgsave_status:ok
rdb_last_bgsave_time_sec:0
rdb_current_bgsave_time_sec:-1
rdb_last_cow_size:294912
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
aof_last_write_status:ok
aof_last_cow_size:0
# Stats
total_connections_received:9213369
total_commands_processed:575153203
instantaneous_ops_per_sec:4189
total_net_input_bytes:374022659065
total_net_output_bytes:718721749681
instantaneous_input_kbps:2587.72
instantaneous_output_kbps:5761.27
rejected_connections:0
sync_full:1
sync_partial_ok:0
sync_partial_err:1
expired_keys:0
expired_stale_perc:0.00
expired_time_cap_reached_count:0
evicted_keys:0
keyspace_hits:22961146
keyspace_misses:3707
pubsub_channels:1
pubsub_patterns:0
latest_fork_usec:368
migrate_cached_sockets:0
slave_expires_tracked_keys:0
active_defrag_hits:0
active_defrag_misses:0
active_defrag_key_hits:0
active_defrag_key_misses:0
# Replication
role:master
connected_slaves:1
master_replid:ba3b6fd43ed2f0f336b4166e3a2ee5060a1151c5
master_replid2:ceccbc431f46f04ea7c32882de68c26d1f1f6c3b
master_repl_offset:8873053474828
second_repl_offset:8443132203955
repl_backlog_active:1
repl_backlog_size:1000000000
repl_backlog_first_byte_offset:8872053474829
repl_backlog_histlen:1000000000
# CPU
used_cpu_sys:22945.887250
used_cpu_user:24607.789431
used_cpu_sys_children:0.001750
used_cpu_user_children:0.000000
# Cluster
cluster_enabled:0
# Keyspace
db0:keys=12,expires=0,avg_ttl=0
Metadata
Metadata
Assignees
Labels
Type
Projects
Status