-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Abort command sent to redis #1953
Comments
Hi there! Your scenario is indeed an interesting one, and it's not uncommon to face such challenges when dealing with high-volume systems and Redis. Let's break this down and explore potential solutions. Problem Recap Why Redis Doesn't Natively Support Aborting Commands Potential Solutions
Example in ioredis (Node.js): const Redis = require('ioredis'); // Set a timeout of 1 second
Example Lua script: local start_time = redis.call('TIME')[1] -- Your logic here
Queueing: Use a message queue (e.g., RabbitMQ, Kafka) to handle high-volume requests and process them asynchronously. Caching: Implement a caching layer (e.g., Memcached, local cache) to reduce the number of requests hitting Redis.
Example: const Redis = require('ioredis'); function executeWithTimeout(command, args, timeout) { executeWithTimeout('set', ['key', 'value'], 1000) Command-Level Timeouts: Redis could introduce a mechanism to specify a timeout for individual commands, allowing the server to abort long-running commands. Asynchronous Commands: Redis could support asynchronous execution of certain commands, allowing the client to poll for completion or abort the command. Enhanced Monitoring: Better tools for monitoring and debugging slow commands in real-time. Conclusion |
Hi everyone,
I have an interesting situation.
My scenario is when we execute a high volume of requests to Redis. In this scenario, some Redis response times are high and I want to find a way to abort commands that were executed with long execution periods.
I haven't found a simple way to implement this (e.g. with an AbortController). Has anyone had this experience?
If there is no implementation for this, do you think there is an interesting evolution?
The text was updated successfully, but these errors were encountered: