Trouble on Redis RAM usage behavior

Hi,

Redis version :5.0.7
Amount of RAM on the server : 15G.
maxmemory-policy : volatile-lru
maxmemory : 6.44G
mem_fragmentation_ratio : 1.14

We have an instance of Redis on our Linux server. This instance of Redis is used on a PHP application. We ‘discover’ that we’ve huge fall of memory usage when the maxmemory amount is hit. This brutal fall affects our db graph. See bellow a graph representing the fall of the memory usage when redis hit max memory usage limit :

image

Is this pattern a ‘normal’ pattern for the given maxmemory policy ?
Furthermore, i’m asking myself if it’s a good practice to restart the redis instances in order to purge the redis cache at specific and controlled time ? For example, every night.

Best regards,

Please provide more details about your keyspace (INFO ALL, or INFO MEMORY & INFO STATS & INFO KEYSPACE)

INFO MEMORY :

# Memory used_memory:6442160912 used_memory_human:6.00G used_memory_rss:7506419712 used_memory_rss_human:6.99G used_memory_peak:6442619352 used_memory_peak_human:6.00G used_memory_peak_perc:99.99% used_memory_overhead:31949160 used_memory_startup:787976 used_memory_dataset:6410211752 used_memory_dataset_perc:99.52% allocator_allocated:6442375952 allocator_active:7409078272 allocator_resident:7519395840 total_system_memory:16773713920 total_system_memory_human:15.62G used_memory_lua:41984 used_memory_lua_human:41.00K used_memory_scripts:0 used_memory_scripts_human:0B number_of_cached_scripts:0 maxmemory:6442450944 maxmemory_human:6.00G maxmemory_policy:volatile-lru allocator_frag_ratio:1.15 allocator_frag_bytes:966702320 allocator_rss_ratio:1.01 allocator_rss_bytes:110317568 rss_overhead_ratio:1.00 rss_overhead_bytes:-12976128 mem_fragmentation_ratio:1.17 mem_fragmentation_bytes:1064342496 mem_not_counted_for_evict:0 mem_replication_backlog:0 mem_clients_slaves:0 mem_clients_normal:3019544 mem_aof_buffer:0 mem_allocator:jemalloc-5.2.1 active_defrag_running:0 lazyfree_pending_objects:0 

INFO STATS :

# Stats total_connections_received:41669227 total_commands_processed:4507027762 instantaneous_ops_per_sec:7987 total_net_input_bytes:864965196534 total_net_output_bytes:66856177812671 instantaneous_input_kbps:1657.71 instantaneous_output_kbps:30558.57 rejected_connections:0 sync_full:0 sync_partial_ok:0 sync_partial_err:0 expired_keys:5913479 expired_stale_perc:0.74 expired_time_cap_reached_count:0 evicted_keys:7839 keyspace_hits:3572609020 keyspace_misses:581662138 pubsub_channels:0 pubsub_patterns:0 latest_fork_usec:0 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 

INFO KEYSPACE :

# Keyspace db1:keys=460000,expires=33771,avg_ttl=9868334 

Our redis server is running under Ubuntu 20.04.4 LTS

Thanks.