Skip to content

[Question] How to manage states correctly and efficiently? #3392

Answered by picklelo
luozhouyang asked this question in Q&A
Discussion options

You must be logged in to vote

If the websocket reconnects, will the state be restored automatically?

Yes, each user tab has a token that maintains a state on the backend. So even through reconnects / refreshes the state should maintain. See the architecture post for more info.

If I deploy multiple pods in a k8s cluster, how do I store state correctly?

You will want to use Redis in this case, and set the redis_url in the rxconfig.py or as an environment variable. This will use Redis as the state manager instead of the in-memory one. See here - we need to link this in our main website docs.

Using Redis as a state manager will consume a lot of memory when there are a large number of users. Is there any other solutio…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by luozhouyang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants