Azure cosmosdb 降低CosmosDB的已调配吞吐量

Azure cosmosdb 降低CosmosDB的已调配吞吐量,azure-cosmosdb,Azure Cosmosdb,我有一个cosmosDB,它在数据库级别配置了4个容器和400RU。我添加了2个容器,在没有警告的情况下,供应的RU增加到600 下面的文档解释了发生这种情况的原因。4号以上的每个容器至少需要额外的100RU。我有严格的预算限制,所以我删除了2个容器,但我找不到降低最低配置吞吐量的方法,因为配置吞吐量下拉列表只允许增加。有没有办法降低吞吐量 如中所述,您可以通过使用cosmos db sdk来减少吞吐量设置。例如,我测试JavaSDK以减少容器吞吐量设置。请参阅以下代码: import com.

我有一个cosmosDB,它在数据库级别配置了4个容器和400RU。我添加了2个容器,在没有警告的情况下,供应的RU增加到600

下面的文档解释了发生这种情况的原因。4号以上的每个容器至少需要额外的100RU。我有严格的预算限制,所以我删除了2个容器,但我找不到降低最低配置吞吐量的方法,因为配置吞吐量下拉列表只允许增加。有没有办法降低吞吐量

如中所述,您可以通过使用cosmos db sdk来减少吞吐量设置。例如,我测试JavaSDK以减少容器吞吐量设置。请参阅以下代码:

import com.microsoft.azure.documentdb.*;

import java.util.Iterator;

public class ChangeRUTest {

    static private String YOUR_COSMOS_DB_ENDPOINT = "https://***.documents.azure.com:443/";
    static private String YOUR_COSMOS_DB_MASTER_KEY="***";

    public static void main(String[] args) throws DocumentClientException {

        DocumentClient client = new DocumentClient(
                YOUR_COSMOS_DB_ENDPOINT,
                YOUR_COSMOS_DB_MASTER_KEY,
                new ConnectionPolicy(),
                ConsistencyLevel.Session);

        String collectionLink = "dbs/test/colls/one";

        String collectionResourceId = client.readCollection(collectionLink, null).getResource().getResourceId();

        // find offer associated with this collection
        Iterator<Offer> it = client.queryOffers(
                String.format("SELECT * FROM r where r.offerResourceId = '%s'", collectionResourceId), null).getQueryIterator();

        Offer offer = it.next();

        System.out.println(offer.getContent().getInt("offerThroughput"));

        // update the offer
        int newThroughput = 400;
        offer.getContent().put("offerThroughput", newThroughput);
        client.replaceOffer(offer);

    }
}

你知道使用MongoDB Api实现Cosmos DB的方法吗?@HamishAnderson试图为你找到一种方法。有没有办法获得范围吞吐量?