I run into scaling issue recently with my chatbot which uses Rasa stack. I found out that Rasa-core started to slow down during my load test. I tested against it by spawning 100 users constantly interact with my chatbot through a socketio channel. I noticed it spent a lot of time on saving and retrieving data from the Redis tracker store. Most of the transactions took more than 500ms to be completed during my test.
I understand that I can get a better result by scaling up more chatbot instances but 100 users seem like a fairly low traffic to me. I had also gevent monkey-patch my rasa-core instance to allow non-blocking calls but it still takes a long time to process those Redis calls. I am not sure if Rasa-core or Redis is the bottleneck here.
If someone has some ideas on optimizing it, that would be helpful for me. Thanks in advance!
Its because, as users are sending lots of messages, the tracker objects gets too big with events and serializing and deserializing the tracker around takes too much time.
I did dig deep into the code and able to solve by writing custom TrackerStore,
class MyCustomRedisTrackerStore(RedisTrackerStore):
read the existing events and delete the old events and save them back to the store. Hope this helps you too.