title: Redis Expiration not working
body: <p>I am using Redis Pub/Sub model (<a href="https://redis.io/topics/pubsub" rel="nofollow noreferrer">https://redis.io/topics/pubsub</a>), and I am using jedis client for the same. I have subscribed to redis expiration. This works perfectly when redis has smaller number of keys. But if I have >1 million keys with different TTL, then the expiration of the keys does not always happen according to the TTL of the key.  </p>
  
  <p>From the redis documentation (<a href="https://redis.io/commands/expire" rel="nofollow noreferrer">https://redis.io/commands/expire</a>) :</p>
  
  <pre><code>Specifically this is what Redis does 10 times per second:
  1. Test 20 random keys from the set of keys with an associated expire.
  2. Delete all the keys found expired.
  3. If more than 25% of keys were expired, start again from step 1.
  </code></pre>
  
  <p>So with large number of keys it is possible that the random keys chosen have a higher TTL and hence the steps 2 and 3 don't get executed.</p>
  
  <p>How do I solve this, or can I use something other than redis, to achieve this ?</p>