2

Made a simple NodeJS app that uses Mongoose client to connect to CosmosDB (via MongoDB API).

After a while I noticed that my CosmosDB instance is receiving many IsMaster requests from my application (+12 times per minute). Image bellow:

https://i.stack.imgur.com/M5MXr.png

Azure treats this as RUs, and charge me for it.

Is this normal?

My connection options are as follows:

{ 
  ssl: true,
      useNewUrlParser: true,
      promiseLibrary: global.Promise,
      auth: {
            user: "admin",
            password: "123456"
     }
}
GCSDC
  • 3,138
  • 3
  • 28
  • 48
  • Each operation has an RU cost. Depending on your RU allocation, you likely won't ever notice 12 / minute (that's once per 5 seconds?), and RU is allocated per-second. At most, you're seeing one call within a one-second period. Not sure you'd ever have an issue with this, unless you were pushing the limits of your RU allocation and hitting throttling. Regardless, no individual call will have a monetary cost; that's baked into your RU/second setting. – David Makogon Mar 20 '19 at 23:54
  • Thanks David, after a bit of digging it seems that Azure mandates provisioned throughput (RU/seconds settings u referred to) on collections (if u didn't enable it for the database). This seems to be the driver of the charges and not the isMaster request. – ValidOutputs Mar 23 '19 at 16:14
  • @ValidOutputs could you please elaborate a little bit on what your solution was? I am currently experiencing the same issue. – Paweł Jul 08 '19 at 11:23
  • @Paweł When you create a database/collection through mongoose against Azure CosomosDB, then Azure will pickup some default settings. Which are "No database wide throughput", "Each collection will have a throughput of 1000 RU/s". 1000 RU/s will cost about $30-$50 per month. If you are experimenting for now, go to Azure CosmosDB and lower the value to 400 RU/s. Also consider creating the DB right from Azure with Database wide throughput, otherwise you will be charged for extra for each collection you create by mongoose. Hope this helps! – ValidOutputs Jul 08 '19 at 16:10

0 Answers0