0
votes

I know that you can use Redis for the communication between socket.io sockets from different cluster workers in node.js and also for sharing other objects between these workers.

But I'm struggling with the following:

Does the persistence of Redis data get in the way of this? How can I be sure that the socket data is removed from redis when the master process is closed? And how can I ensure the same for the objects? I only need this data until the processes/sockets terminate.

Maybe I have to remove the save-to-disk interval and reload the whole Redis server on master-start?

Thanks so much.

1
If you're sure you don't need persistence for anything in your Redis instance, disabling it is the easiest way to go.Michael Mior
i understand, but the thing is that I'd like to have no information of the old sockets/objects sitting in the ram of the old node session when i restart node. is there any way to quickly clear everything from redis (or a group of sets)? or what would you recommend for that matter? would you recommend restarting it? thanks in advance :)Kokoberko
FLUSHDB will empty everything from the current Redis database, or FLUSHALL will delete everything from all databases.Michael Mior
@If that solved your problem, posted as answer you can accept.Michael Mior

1 Answers

1
votes

You can use FLUSHDB to delete all data from the current database or FLUSHALL to delete all data from all databases.