# How to improve the response time of rasa bot

**URL:** <https://forum.rasa.com/t/how-to-improve-the-response-time-of-rasa-bot/46994>\
**Category:** Rasa Open Source\
**Created:** [August 18, 2021, 6:51am UTC](https://forum.rasa.com/t/how-to-improve-the-response-time-of-rasa-bot/46994 "2021-08-18T06:51:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ermarkar](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/ermarkar/32/13716_2.png) [@ermarkar](https://forum.rasa.com/u/ermarkar)\
**Post date:** [August 18, 2021, 6:51am UTC](https://forum.rasa.com/t/how-to-improve-the-response-time-of-rasa-bot/46994/1 "2021-08-18T06:51:34Z")

</div>

Using rasa as python library I am loading two agents (with different models, with around 60 intents), Both models are in memory.

If i hit single request it takes between 2-4 seconds, now from JMeter if i hit 100 requests in parallel with 10 sec ramp-up period then it response time starts from 2 sec to 120sec and the average is 60 sec.

What can be the general solutions that can be applied to reduce the response time ? any suggestions while training model? even for the single request it is taking 2-4 seconds.

---

<div class="post-metadata">

**Author:** ![Dustyposa](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/dustyposa/32/13745_2.png) [@Dustyposa](https://forum.rasa.com/u/Dustyposa)\
**Post date:** [August 19, 2021, 6:16am UTC](https://forum.rasa.com/t/how-to-improve-the-response-time-of-rasa-bot/46994/2 "2021-08-19T06:16:30Z")

</div>

Have do any performance analysis?  
Do the network cost much or any others ?

---

<div class="post-metadata">

**Author:** ![ermarkar](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/ermarkar/32/13716_2.png) [@ermarkar](https://forum.rasa.com/u/ermarkar)\
**Post date:** [August 19, 2021, 7:19am UTC](https://forum.rasa.com/t/how-to-improve-the-response-time-of-rasa-bot/46994/3 "2021-08-19T07:19:17Z")

</div>

yes, with JMeter, tested the performance testing, for 100 requests avg rasa response time is 60seconds. even for 50 users it is taking 56 seconds.

---

<div class="post-metadata">

**Author:** ![Dustyposa](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/dustyposa/32/13745_2.png) [@Dustyposa](https://forum.rasa.com/u/Dustyposa)\
**Post date:** [August 20, 2021, 2:39am UTC](https://forum.rasa.com/t/how-to-improve-the-response-time-of-rasa-bot/46994/4 "2021-08-20T02:39:21Z")

</div>

You can try the profiling tool, like: Pyinstrument  
I think you need to know which steps make it be slow, and to improve performance for the step.

---

<div class="post-metadata">

**Author:** ![ermarkar](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/ermarkar/32/13716_2.png) [@ermarkar](https://forum.rasa.com/u/ermarkar)\
**Post date:** [August 20, 2021, 7:20am UTC](https://forum.rasa.com/t/how-to-improve-the-response-time-of-rasa-bot/46994/5 "2021-08-20T07:20:02Z")

</div>

> [@Dustyposa](#):
>
> Pyinstrument

ok will try thanks!!! any other general solutions to improve the performance??

---

<div class="post-metadata">

**Author:** ![Dustyposa](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/dustyposa/32/13745_2.png) [@Dustyposa](https://forum.rasa.com/u/Dustyposa)\
**Post date:** [August 23, 2021, 6:10am UTC](https://forum.rasa.com/t/how-to-improve-the-response-time-of-rasa-bot/46994/6 "2021-08-23T06:10:39Z")

</div>

A lot, which step cost time. To optimize it.  
For model, you can compress it or change model.  
For calculate, you can use rust for multi thread.  
etc…
