Cosmos db in azure takes 7-10 seconds to complete

John Newsome 51 Reputation points
2022-10-17T02:20:31.94+00:00

I'm running this code from a cosmos db in azure and it takes 7 seconds to run
await this._container.UpsertItemAsync<Heading>(header, new PartitionKey(headingId)

when I run it locally to my cosmos db emulator it takes milliseconds

the scale and indexes are set to the same. who can I speak to about this. it makes no sense and my application is running really slow because of it.

thanks in advance, John

Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,469 questions
{count} votes

1 answer

Sort by: Most helpful
  1. ShaktiSingh-MSFT 13,991 Reputation points Microsoft Employee
    2022-10-17T08:16:31.447+00:00

    Hi anonymous user,

    Thanks for posting question in Microsoft Q&A and for using Azure Services.
    Sorry about the inconvenience you are facing.

    As per your question, it appears DB is taking 7-10 seconds in query execution while in Emulator it takes milliseconds.

    Could you please let us know the application in use with Cosmos DB? If using application, please try to use the latest version sdk.

    However, there are some improvements to the query caching that are available in 4.20.0 and some more bug fixes around the same in 4.26.0 and 4.3.0

    Could you please try the operations post upgrades to the above libraries and check if the performance has improved.

    Additionally, please check Network configuration or VNET Integration.

    Hope this will help. Please let us know if any further queries.

    ------------------------------

    • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you.
      Original posters help the community find answers faster by identifying the correct answer. Here is how
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification
    0 comments No comments