我有从 Azure IoT 中心推送的数据 -> 流分析 -> CosmosDB
我有 1 个模拟设备,我的 Cosmos DB 集合为 1000 RU/s,运行良好。 现在我已经将其设置为 10 个模拟设备,并且我的 Cosmos DB 集合已扩展到 15000 RU/s,但我的流分析性能仍然下降。
我是否需要增加集合的并行连接数?
我们能否使其更加优化,如 Cosmos DB 的 Azure 定价,取决于吞吐量和 RU
最佳答案
Can we make it more optimal as Azure pricing of Cosmos DB, depend on throughput and RUs?
我只是想在这里与大家分享一些关于提高 Cosmos db 写入性能的想法。
1.一致性级别
基于document :
Depending on what levels of read consistency your scenario needs against read and write latency, you can choose a consistency level on your database account.
您可以尝试将一致性级别设置为最终
。详情请引用here .
2.索引:
基于文档:
by default, Azure Cosmos DB enables synchronous indexing on each CRUD operation to your collection. This is another useful option to control the write/read performance in Azure Cosmos DB.
请尝试将索引设置为惰性。另外,删除无用的索引。
3.分区:
基于document :
Azure Cosmos DB unlimited are the recommended approach for partitioning your data, as Azure Cosmos DB automatically scales partitions based on your workload. When writing to unlimited containers, Stream Analytics uses as many parallel writers as previous query step or input partitioning scheme.
请对您的集合进行分区并在输出中传递分区键以提高写入性能。
关于将数据推送到 Cosmos DB 时 Azure 流分析作业降级,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52998323/