Author Topic: High Fragmentation Rate in Redis as Session Cache in a small environment  (Read 1195 times)

Offline Granada

  • Jr. Member
  • **
  • Posts: 35
Hi all!

I've upgraded one of our two Rouncdube-Instances to RC1.5 and a new server hardware with RHEL 8.x and switched the session cache to a Redis database. I've read a lot about configuring Redis as an LRU-Cache and how to optimize memory, but whatever I do, the fragmentation ratio remains at values above 5 to over 10, which is directly dependant on the number of sessions stored in Redis. At nigh the fragementation is high and during daytimes it gets lowest.
The database stores just about 1000 sessions at max, consumes about 2.5MB at most and the server is a virtual host with 16GB of RAM which it does not need at all, but memory is cheap.

Is there any way to reduce the fragmentation ratio of Redis? I can get the fragmentation ratio as low as 1.2 when filling the database with fake lru-entries (e.g. with a simple performance check), but I'm sure this is not the optimal solution. :)

Regard
Julia