How to maintain bot state when using multiple gunicron workers?

smartSense 6 Reputation points
2022-01-31T12:36:01.637+00:00

I have developed a chatbot using azure bot framework SDK, it is using python aiohttp and asyncio to handle requests.
It is deployed on the azure app service and is running through gunicron, but its ability to handle multiple users is low it can only handle 3-4 users per second, I like to increase its capacity.

To do so I did some research and found that with multiple gunicron workers we can handle more users. But when I am using 3 workers instead of 1 on one CPU core, the bot's state is not maintained and it again asks the same question which user has already answered. I am using waterfall dialog for my bot.

I tried to have a JSON file that maintains the user state in local, but that is also not working.

Please help me with the issue as there are at least 1000 users per second is forecasted.

NOTE:- Scaling vertically does not resolve the issue and it does not increase capacity to handle even 100 users per sec. I am a beginner at bot framework and azure.

Any help would be appreciated.

Thank you

Azure AI Bot Service
Azure AI Bot Service
An Azure service that provides an integrated environment for bot development.
742 questions
{count} vote