We want to deploy a payload instance with azure - but when registering or just saving a post - we're always reaching the RU limit for some reason
Error message:
Response status code does not indicate success: BadRequest (400); Substatus: 1028; ActivityId: ; Reason: (Message: {"Errors":["Your account is currently configured with a total throughput limit of 1600 RU\/s. This operation failed because it would have increased the total throughput to 2000 RU\/
Interesting. Do any other operations succeed? Are you performing any seeding on startup that would possibly be hitting your database? I'm not familiar with Azure's RU's. Would 2000 RU be a big jump over 1600?
This could be an index thing as well. For Cosmos, you'll want to set
indexSortableFields
to true - try that out and see if it makes a difference.
https://payloadcms.com/docs/configuration/overview#optionsi actually switched to serverless cosmosdb - and now everything works pretty nice - i'll also post some screenshots - but it seems, that while creating the indexes - it got up to 2400 RUs - for a short time. - this would mean setting up cosmosdb for 2400RUs - about 200€/month & the problem is - that with cosmosdb - you cannot downsize the instance anymore.
Maybe adding a notice to the docs would be good - or maybe in the future even optimising the setup
@dribbens Have you seen anything like this with clients running Cosmos?
Not too sure about existing setup costs. I wonder if cosmosDB is rebuild the indexes on a large collections on every startup? I would have to do some digging to find out. You could try setting
autoIndex: false
in your mongo options in the Payload config in production.
What practical effect does
autoIndex: false
have on the CMS?
yes, exactly the same problem for me too
but the cosmos db api is timing our app service because of absurd amounts of RU's
For anyone stumbling upon this. The current workaround is to use serverless Cosmos DB. Issue tracked here:
https://github.com/payloadcms/plugin-cloud-storage/issues/64That's not really a solution. That just means I'll get billed for the silly amount of RUs Payload is using rather than my app getting throttled.
Correct, I used the term workaround. The issue is open to look into a viable solution.
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.