botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

[Directline] websocket slow response

Open 10p30pl3 opened this issue 9 years ago • 3 comments

Bot Info

  • Bot handle: iop1
  • App ID: 249488d0-9993-4dbe-833c-0453fd060024
  • SDK Platform: nodejs
  • SDK Version: latest
  • Active Channels: directline
  • Deployment Environment:

Issue Description

I'm using directline with websockets the bot response is taking about 30s each message to arrive to client

Code Example

any

Reproduction Steps

  1. say Hello to bot
  2. directline server responds to hello
  3. message takes 30s or more to arrive to websocket client

Expected Behavior

message should arrive on client within seconds

Actual Results

inconsistency, messages take long time to come or never arrive to direct line client

10p30pl3 avatar Sep 12 '17 20:09 10p30pl3

I just tested your bot on skype and webchat, the first message is the only one that took a long time to show up. All the other messages took about 1-3 seconds which is fairly normal. For directline are all messages slow?

Keep in mind after 15 minutes of non-use your bot will go to sleep so the first message will generally be slow. there are ways to avoid this. First, you can enable always on assuming you are using Azure. The second option is to set up something like a web job that will ping your bot every 15 minutes to keep it awake.

JasonSowers avatar Sep 13 '17 17:09 JasonSowers

I experienced slowness only on directline channel. Is there any recommendation when using websockets, like number of sockets or conversations / hour limitation?

10p30pl3 avatar Sep 14 '17 18:09 10p30pl3

Slow response on first message is a known issue and there's currently no work-around.

The best thing to do in this scenario is to keep your bot active. Via users or other test automation.

nwhitmont avatar Oct 09 '17 22:10 nwhitmont