-
Notifications
You must be signed in to change notification settings - Fork 705
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
CosmosDb partitioning strategy causing high cost/low perf, max quota/too many requests #238
Comments
Thank you for reporting this. I've gotten a bit more context from Harleen as well. Will the customer require a tool to migrate their existing chats? |
Linked branch with core fix: CosmosDB database and container are created during deployment (not by code). The partitioning scheme is defined at this time in scripts/deploy/main.bicep. If no migration is required (as Devis stated), the containers can simply be deleted and redeployed along with the updated application.
If migration pathway is required or some other type of schema-version detection, let's identify and iterate on those cases. |
Draft PR - #240 Following up w/ Tao tomorrow to explore deployment options to realize this change w/ minimal fuss. |
…240) ### Motivation and Context Customer issue reported in #238 related to partition scheme in cosmosdb containers. ### Description Update partition-key path definition for `ChatMessage`, `ChatPartitipant`, and `MemorySource`. Existing deployments will continue to work in their current mode. CosmosDB containers must be removed and redeployed to realize the peformance update related to the partition scheme. ### Contribution Checklist - [x] The code builds clean without any errors or warnings - [x] The PR follows the [Contribution Guidelines](https://github.com/microsoft/copilot-chat/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/copilot-chat/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [x] All unit tests pass, and I have added new tests where possible - [x] I didn't break anyone 😄
chatsessions
table is partitioned by ID, but should be partitioned by User and have an index on the IDchatmessages
table is partitioned by ID, but should be partitioned by Chat IDIn the current setup, as these tables grow, CosmosDb takes more and more time to execute these operations:
Other than increasing latency, also the incurred cost in RUs (and $) grows, with the risk of hitting Max Quota when autoscale is not enabled.
The text was updated successfully, but these errors were encountered: