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

Changes to account for concurrent processing of application requests. #73

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/backend/botservice/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ async def on_message_activity(self, turn_context: TurnContext):

await turn_context.send_activity(Activity(type=ActivityTypes.typing))

answer = brain_agent_executor.invoke({"question": input_text}, config=config)["output"]
answer = (await brain_agent_executor.ainvoke({"question": input_text}, config=config))["output"]

await turn_context.send_activity(answer)

Expand Down
13 changes: 13 additions & 0 deletions apps/backend/botservice/gunicorn.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import multiprocessing

max_requests = 1000
max_requests_jitter = 50
log_file = "-"
bind = "0.0.0.0"

timeout = 230
# https://learn.microsoft.com/en-us/troubleshoot/azure/app-service/web-apps-performance-faqs#why-does-my-request-time-out-after-230-seconds

num_cpus = multiprocessing.cpu_count()
workers = (num_cpus * 2) + 1
worker_class = "uvicorn.workers.UvicornWorker"