# Is there any suggestion for optimize socket response time

**URL:** <https://forum.rasa.com/t/is-there-any-suggestion-for-optimize-socket-response-time/53187>\
**Category:** Rasa Open Source\
**Created:** [May 15, 2022, 2:49am UTC](https://forum.rasa.com/t/is-there-any-suggestion-for-optimize-socket-response-time/53187 "2022-05-15T02:49:37Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![RUI-LONG](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/rui-long/32/19368_2.png) [@RUI-LONG](https://forum.rasa.com/u/RUI-LONG)\
**Post date:** [May 15, 2022, 2:49am UTC](https://forum.rasa.com/t/is-there-any-suggestion-for-optimize-socket-response-time/53187/1 "2022-05-15T02:49:37Z")

</div>

Hi there, I’m using socketIO for chatbot integertion.   
When I send a new message, it cost about 3~5 seconds to response.   
Is there any way to lower the response time?

My current model has 350+ intents, and using MemoizationPolicy、TEDPolicy and RulePolicy. (Mongodb for tracker store.

I read this thread, but it still needs 3~5 seconds to response after I clear the tracker.

> [@Rasa core performance issues](http://forum.rasa.com/t/rasa-core-performance-issues/8784/2):
>
> @ggbond when you spawned your 100 users, at what rate do these users send messages? I am not sure if Rasa-core or Redis is the bottleneck here. Can you try switching to the in-memory tracker store and compare performance?

OS: Win 10 Rasa version: 2.8 Python version: 3.7 Rasa X, Rasa SDK: Not using

Thanks in advance

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [May 15, 2022, 1:13pm UTC](https://forum.rasa.com/t/is-there-any-suggestion-for-optimize-socket-response-time/53187/2 "2022-05-15T13:13:11Z")

</div>

@RUI-LONG what is your front-end?

---

<div class="post-metadata">

**Author:** ![RUI-LONG](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/rui-long/32/19368_2.png) [@RUI-LONG](https://forum.rasa.com/u/RUI-LONG)\
**Post date:** [May 15, 2022, 9:45pm UTC](https://forum.rasa.com/t/is-there-any-suggestion-for-optimize-socket-response-time/53187/3 "2022-05-15T21:45:51Z")

</div>

@nik202I’m using rasa-webchat v1.0.1 for front-end

> **[GitHub - botfront/rasa-webchat: A feature-rich chat widget for Rasa and Botfront](https://github.com/botfront/rasa-webchat)**
>
> A feature-rich chat widget for Rasa and Botfront. Contribute to botfront/rasa-webchat development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [May 16, 2022, 1:34pm UTC](https://forum.rasa.com/t/is-there-any-suggestion-for-optimize-socket-response-time/53187/4 "2022-05-16T13:34:27Z")

</div>

@RUI-LONG means you are looking for a fast response time for the bot is that right?

---

<div class="post-metadata">

**Author:** ![RUI-LONG](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/rui-long/32/19368_2.png) [@RUI-LONG](https://forum.rasa.com/u/RUI-LONG)\
**Post date:** [May 16, 2022, 10:15pm UTC](https://forum.rasa.com/t/is-there-any-suggestion-for-optimize-socket-response-time/53187/5 "2022-05-16T22:15:44Z")

</div>

@nik202 Yes, I’m looking for faster response time   
Is there any suggestions? Thanks for response

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [May 16, 2022, 10:30pm UTC](https://forum.rasa.com/t/is-there-any-suggestion-for-optimize-socket-response-time/53187/6 "2022-05-16T22:30:50Z")

</div>

@RUI-LONG mention this in the bot front snippet code and see the difference

```auto
customMessageDelay: (message) => {
          let delay = message.length * 30;
          if (delay > 3 * 200) delay = 3 * 200;
          if (delay < 100) delay = 100;
          return delay;

```

Good Luck!!

---

<div class="post-metadata">

**Author:** ![RUI-LONG](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/rui-long/32/19368_2.png) [@RUI-LONG](https://forum.rasa.com/u/RUI-LONG)\
**Post date:** [May 17, 2022, 12:35am UTC](https://forum.rasa.com/t/is-there-any-suggestion-for-optimize-socket-response-time/53187/7 "2022-05-17T00:35:28Z")

</div>

@nik202 Thanks!!! It really helps a lot.
