Multi Threading problem

Hi, I have an action that takes about 2 minutes to respond. During this time the chatbot is not able to process other users for another action until the action completes. Do you have any solutions please? @erohmensing

Hi @wassimgt
I am also facing the sane issue
If u get the solution kindly share
Thanks

1 Like

Hi @wassimgt @vi.kumar. What part of your action takes 2 minutes to respond? Are you doing 2 minutes of processing within your action server, or are you calling another endpoint from your action server that takes 2 minutes to return?

If the second, I recommend you make your run method async (which is available by default in rasa sdk > 1.6) and await the result of your long-running endpoint

@erohmensing I spoke the other time here on my chatbot and the timeout problem,

the problem when I call another action after the prediction action (running)

Hi @erohmensing
My Query is -
RASA actions server perform the requests sequentially . If one action(say “action_1”) is under progress and in between if another user called another action (say “action_2”) . I found that rasa action server first complete action_1 and then process action_2.
My requirements- I want rasa actions server to perform both actions parallelly , if this doesn’t happen then users will remain in waiting queue for a long time if number of users increase .
For reference, I am providing u the logs :
My rasa model server has these properties:
2020-08-26 17:39:46 DEBUG rasa.core.tracker_store - Attempting to connect to database via ‘sqlite://:***@/rasa_server.db’.
2020-08-26 17:39:46 DEBUG rasa.core.tracker_store - Connection to SQL database ‘rasa_server.db’ successful.
2020-08-26 17:39:46 DEBUG rasa.core.tracker_store - Connected to SQLTrackerStore.
2020-08-26 17:39:46 DEBUG rasa.core.lock_store - Connected to lock store ‘InMemoryLockStore’.\

For two queries : i am giving you logs of rasa server and actions server.
Logs of rasa Model server -
Here u can see there are two users with sender_id {sbm.kumar , vi.kumar}
And two Queries - “Find Issues” and “Prediction Issues”\

for “find Issues” -
intent - ask_find_issues_part
action - action_find_issues_part\

for “Prediction Issues” -
intent - ask_predict_issues_part
action - action_predict_issues_part
sbm.kumar request for “Prediction Issues” functionality which comes at 17:52:50
vi.kumar request for “Find Issues” functionality which comes at 17:52:53\

2020-08-26 17:52:50 DEBUG rasa.core.tracker_store - Recreating tracker from sender id ‘sbm.kumar’ 2020-08-26 17:52:50 DEBUG rasa.core.processor - Received user message ‘/ask_predict_issues_part’ 2020-08-26 17:52:50 DEBUG rasa.core.actions.action - Calling action endpoint to run action ‘action_predict_issues_part’.

2020-08-26 17:52:53 DEBUG rasa.core.tracker_store - Recreating tracker from sender id ‘vi.kumar’ 2020-08-26 17:52:53 DEBUG rasa.core.processor - Received user message ‘/ask_find_issues_part’ 2020-08-26 17:52:53 DEBUG rasa.core.actions.action - Calling action endpoint to run action ‘action_find_issues_part’.\

Logs of rasa actions server -
At 17:52:39 - “Prediction Issues” functionality executes.
“api for predicting issues is called.” this api takes time to fetch result .
Until this api is completed there is no log of “Find Issues” custom action.
U can check this from timestamp.
Once “action_predict_issues_part” completes then at 17:53:52 “action_find_issues_part” starts\

[2020-08-26 17:52:39] “POST /webhook HTTP/1.1” 200 1842 0.019000
action_predict_issues_part
api for predicting issues is called.
action_completed

[2020-08-26 17:53:52] “POST /webhook HTTP/1.1” 200 12050 62.046102
action_find_issues_part
action_completed

My Observations-
The behaviour of Rasa Model server is Async and Parallel ,
But behaviour of Rasa Actions server to execute custom actions is sequential\

Kindly tell me what i can do or am i missing anything to make you understand my query.