Reputation: 292
I am very new to redis and this has always made me curious.
I am using a single redis client connection in nodejs (npm's redis package) which is included in each of my files.
Say for eg : File a.js is used for reading from mysql and inserting the data into redis hash ,file b.js reads from redis hash and outputs the result.
Now in a production environment i have a large numbers of request comming to b.js files which serves the content and in between i have a few request being made to a.js files to update the contents on the fly.
I want to know if a request to a.js slows down the already running redis connection in b.js.
Upvotes: 5
Views: 9255
Reputation:
No, the connection will not be slow down. What will slow down is the response time from redis. But I doubt you will notice as we are talking about a few micro-seconds per request.
Upvotes: 1
Reputation: 579
Redis is single threaded, so if it's busy writing data, your reads will be delayed.
You'll find more information in this SO answer: Redis is single-threaded, then how does it do concurrent I/O?
Upvotes: 5
Reputation: 1454
Redis is single threaded then there is no concurrent read/write. If there are 2 client connection sending command to the redis they will be queued.
Then yes if a.js send a lot of commands to the Redis, b.js commands will be inserted between a.js commands
Upvotes: 1