Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MS Teams - Bot framework bot is slow #11583

Closed
gykung opened this issue Sep 13, 2024 · 9 comments
Closed

MS Teams - Bot framework bot is slow #11583

gykung opened this issue Sep 13, 2024 · 9 comments
Assignees
Labels
teams-developer-support Question related to extensibility (Bot, ME, Tab) would be marked under this label

Comments

@gykung
Copy link

gykung commented Sep 13, 2024

Steps to reproduce

I have a bot, written in Python, bot framework, run on a local VM, connected via ngrok to my bot app for my enterprise. User messages take about 5-7 seconds before it reaches the bot/VM. Does anyone else face a similar issue? What’s the typical latency expected?

One interesting observation: during the crowdstrike incident, the bot responded significantly faster. My enterprise was not affected by crowdstrike.

Sorry for asking this question here, I am not sure where else to ask this.

Expected behavior

Nearly zero lag.

Actual behavior

5-7 seconds lag.

Error details

No response

@Meghana-MSFT Meghana-MSFT self-assigned this Sep 13, 2024
@Meghana-MSFT Meghana-MSFT added teams-developer-support Question related to extensibility (Bot, ME, Tab) would be marked under this label and removed needs-triage 🔍 labels Sep 13, 2024
@Meghana-MSFT
Copy link
Collaborator

Meghana-MSFT commented Sep 13, 2024

Hello @gykung - Thanks for raising your query:

The latency experienced by you where user messages take about 5-7 seconds to reach the bot/VM when running on a local VM connected via NgRok is not typically expected. This delay could be due to various factors such as network configuration, VM performance, or ngrok settings.

It's recommended to check and optimize these aspects to reduce latency:
Optimize VM performance: Ensure the VM has enough resources (CPU, memory) to handle requests efficiently.
Create and host a dev tunnel: (Alternative for NgRok and recommended by Microsoft) https://learn.microsoft.com/en-us/azure/developer/dev-tunnels/get-started?tabs=windows
Upgrade ngrok plan: Consider using a paid ngrok plan for better routing and reduced latency.
Test direct hosting: Consider hosting the bot on a cloud provider (e.g., Azure, AWS) instead of a local VM to reduce the latency caused by local network and NgRok/Dev Tunnel.

@Meghana-MSFT
Copy link
Collaborator

@gykung - Could you please share the bot id with us at [email protected]. Also, please note that

A host (and a bot is just a webapp host) not receiving a message or it's slow getting there is 999 times out of 1000 a network issue.

Python, like JS, is a single threaded core. So, it's not hard to imagine in a very high load situation where the bot is just backed up. But this is rare since, A) Very high load, B) Mostly applies to compute bound situations. i.e., The bot is running some very complex algorithm during each message.

@gykung
Copy link
Author

gykung commented Sep 20, 2024 via email

@Meghana-MSFT
Copy link
Collaborator

@gykung - We have shared the MicrosoftAppId with engineering team, we will keep you posted on the investigation details. Thank you.

@gykung
Copy link
Author

gykung commented Oct 8, 2024 via email

@gykung
Copy link
Author

gykung commented Oct 9, 2024

I presume that the traffic flows this way: User-->teams.microsoft.com-->botframework.com-->ngrok tunnel --> VM hosting the bot, and then in reverse direction to return the response to the user.

I've tried tracert with directly to my ngrok address, with teams.microsoft.com, and botframework.com.

Notably, botframework.com has the most significant lag.

image

@gykung
Copy link
Author

gykung commented Oct 30, 2024

@Meghana-MSFT I've fixed the issue. It was an unexpected issue in the app. Somehow the tracert and network tracing had been giving false clues. Thanks for the time spent on this.

1 similar comment
@gykung
Copy link
Author

gykung commented Oct 30, 2024

@Meghana-MSFT I've fixed the issue. It was an unexpected issue in the app. Somehow the tracert and network tracing had been giving false clues. Thanks for the time spent on this.

@gykung gykung closed this as completed Oct 30, 2024
Copy link
Contributor

Tell us about your experience!

Hi gykung! This issue is closed in our system. We would like your feedback on your experience with our support team and Platform.

Best regards,
Teams Platform

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
teams-developer-support Question related to extensibility (Bot, ME, Tab) would be marked under this label
Projects
None yet
Development

No branches or pull requests

2 participants