Is there any way to remove the Redis keys of completed jobs?

There are multiple options to execute bulk delete in Redis:

  1. executing cron to call redis-cli to delete the keys - below is an example

This command will delete all keys matching users:*
redis-cli --scan --pattern users:* | xargs redis-cli del

If you are in redis 4.0 or above, you can use the unlink command instead to delete keys in the background.

redis-cli --scan --pattern users:* | xargs redis-cli unlink

  1. using Redisgears -

RG.PYEXECUTE “GearsBuilder().filter(lambda x: int(x[‘value’][‘age’]) > 35).foreach(lambda x: execute(‘del’, x[‘key’])).run(‘user:*’)”
Reference: Triggers and Functions | Redis

  1. Client side logic to scan matching keys and delete them in batchs - you can run SCAN command to matching keynames and delete them in batches.
  2. SET key expiry - if you know that particular keys can be processed or failed should not live in Redis more than specific time, then you can set key EX accordingly

Note that depends on number of matching keys the overall process may take time and may impact your production.

Hope this helps.