# Slow API response overtime

**URL:** <https://forum.rasa.com/t/slow-api-response-overtime/50416>\
**Category:** Rasa Open Source\
**Created:** [January 4, 2022, 1:58pm UTC](https://forum.rasa.com/t/slow-api-response-overtime/50416 "2022-01-04T13:58:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ygdo](https://avatars.discourse-cdn.com/v4/letter/y/7cd45c/32.png) [@ygdo](https://forum.rasa.com/u/ygdo)\
**Post date:** [January 4, 2022, 1:58pm UTC](https://forum.rasa.com/t/slow-api-response-overtime/50416/1 "2022-01-04T13:58:30Z")

</div>

Hello,

I’m currently using rasa 2.X and been working on developing tests for my chatbot. I’ve prepared a python script that sends multiple sentences using the POST command (each sentence is sent than a “`/restart`” is sent to clear slots and then a new sentence is sent etc.) I run the server using the command `rasa run --enable-api` and call the script using `python -m "script name"`.

When I run the script the first time it goes very fast (20s for120 sentences). The second run however takes 1min30s. The more runs I do (with the same sentences) the slower it gets. When I hit Ctrl + C on the rasa server and retype `rasa run --enable-api` things get fine.

Could anyone explain to me why this happens and how to solve it without having to restart the server each time.

Thanks

---

<div class="post-metadata">

**Author:** ![stephens](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/stephens/32/1632_2.png) [@stephens](https://forum.rasa.com/u/stephens)\
**Post date:** [January 4, 2022, 9:23pm UTC](https://forum.rasa.com/t/slow-api-response-overtime/50416/2 "2022-01-04T21:23:05Z")

</div>

You should review the logs from rasa and your action server to look for errors and where the time is being spent.

You may also want to add the `--debug` option.

---

<div class="post-metadata">

**Author:** ![ygdo](https://avatars.discourse-cdn.com/v4/letter/y/7cd45c/32.png) [@ygdo](https://forum.rasa.com/u/ygdo)\
**Post date:** [January 5, 2022, 8:08am UTC](https://forum.rasa.com/t/slow-api-response-overtime/50416/3 "2022-01-05T08:08:44Z")

</div>

Did all of that, found no issues in the logs. The server gets slower for each new request, looks like maybe Rasa have some hidden function to prevent DDoS attacks or a cache that gets filled and thus become harder to access/retrieve data. Any clues?

---

<div class="post-metadata">

**Author:** ![stephens](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/stephens/32/1632_2.png) [@stephens](https://forum.rasa.com/u/stephens)\
**Post date:** [January 5, 2022, 5:31pm UTC](https://forum.rasa.com/t/slow-api-response-overtime/50416/4 "2022-01-05T17:31:40Z")

</div>

I’d need to see the debug log from the server to see where it is slowing down.

---

<div class="post-metadata">

**Author:** ![ygdo](https://avatars.discourse-cdn.com/v4/letter/y/7cd45c/32.png) [@ygdo](https://forum.rasa.com/u/ygdo)\
**Post date:** [January 5, 2022, 5:40pm UTC](https://forum.rasa.com/t/slow-api-response-overtime/50416/5 "2022-01-05T17:40:14Z")

</div>

The debug file is huge (thousands of lines for each iteration → 120 sentences sent to the bot) When I launch again the bot, it repeats the same lines, just more slowly this time. I don’t know how to retrieve the debug files, It shows only a limited number of line (n-last lines)
