Closed nicolama-dev closed 1 month ago
Thanks for raising this @nicolama-dev, we'll make sure to address it in v2 👍
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 3 days.
issue addressed on https://github.com/medusajs/medusa/pull/9544
Bug report
Describe the bug
In cache-redis the invalidate function is using KEYS command.
const keys = await this.redis.keys(this.getCacheKey(key))
This command is highly NOT recommended for production setup because it can block the redis server if we have a large amount of keys stored in cache. As a matter of fact Upstash is ignoring KEYS commands when redis sizes > 100k keys.
I experienced myself a degraded Medusa performance with query sometimes hitting 10/15s response time due to this issue.
Below you can find articles from Upstash and Redis advising to use the SCAN command instead that will split the search in several commands:
Upstash article and Redis article