1

We are experience that for every key we are storing in redis urn:xyz a entry in a set ids:xyz is created automatically. see following printscreen

enter image description here

while our keys have an expiration date of 5 days, the entries in the set seem to be stored forever - and our webapplication gets slower and slower.

Can we prevent Redis of writing these indexes? Or is there a simple way to set a expiration date for these entries?

Note: we are using Redis in combination of c# and ServiceStack.Redis for accessing the data.

Cyril Durand
  • 15,834
  • 5
  • 54
  • 62

1 Answers1

1

These indexes are added when you use ServiceStack.Redis high-level generic typed clients. If you used the same typed client to remove the Delete*() the entries these indexes will be automatically removed, but using an expiry only applies to the data not the indexes which is maintained in a SET for each Type so each individual index entry can't have an expiry that matches the payload.

If you're going to be expiring keys I'd suggest avoiding the high-level IRedisTypedClient<T> client and use the string-based IRedisClient APIs instead.

Community
  • 1
  • 1
mythz
  • 141,670
  • 29
  • 246
  • 390