Lock Stores
Lock Stores
Rasa uses a ticket lock mechanism to ensure that incoming messages for a given conversation ID are processed in the right order and locks conversations while messages are actively processed. This means multiple Rasa servers can be run in parallel as replicated services, and clients do not necessarily need to address the same node when sending messages for a given conversation ID.
Contents
InMemoryLockStore (default)
Description
InMemoryLockStore is the default lock store. It maintains conversation locks within a single process.
Note
This lock store should not be used when multiple Rasa servers are run parallel.
Configuration
To use the InMemoryTrackerStore, no configuration is needed.
RedisLockStore
Description
RedisLockStore maintains conversation locks using Redis as a persistence layer. This is the recommended lock store for running a replicated set of Rasa servers.
Configuration
To set up Rasa with Redis, the following steps are required:
- Start your Redis instance
- Add required configuration to your
endpoints.yml
lock_store:
type: "redis"
url: <url of the redis instance, e.g. localhost>
port: <port of your redis instance, usually 6379>
password: <password used for authentication>
db: <number of your database within redis, e.g. 0>
- To start the Rasa Core server using your Redis backend, add the
--endpointsflag, e.g.:
rasa run -m models --endpoints endpoints.yml
Parameters
url(default:localhost): The url of your redis instanceport(default:6379): The port which redis is running ondb(default:0): The number of your redis databasepassword(default:None): Password used for authentication (Noneequals no authentication)use_ssl(default:False): Whether or not the communication is encryptedsocket_timeout(default:10): Time in seconds after which an error is raised if Redis doesn’t answer
👋 I can help you get started with Rasa and answer your technical questions.