Cosmos DB:Gremlin API请求太大异常。如何重试通话

问题描述 投票:1回答:1

我的Azure Cosmos数据库中的吞吐量为1000 RU / s,大约有290个查询要执行。我总是收到请求太大的异常。

每个查询具有12个属性和1个分区键,但是我仍然认为以1000 RU / s的查询应该正确执行。

我有一个gremlinClient

    public static GremlinClient GetGremlinClient()
    {
        var gremlinServer = new GremlinServer(Endpoint, Port, enableSsl: true,
            username: "/dbs/" + Databasename + "/colls/" + Collectionname, password: Authkey);
        var gremlinClient = new GremlinClient(gremlinServer, new GraphSON2Reader(), new GraphSON2Writer(),
            GremlinClient.GraphSON2MimeType);
        return gremlinClient;
    }

示例查询。我只是想添加顶点

g.addV('Experience')。property('_ test','dummy')。property('someProperty','dummy')。property('someProperty','dummy')。property('someProperty', '业务流程文档所有部门以及管理层的了解情况为中型工业企业选择ERP系统;角色:项目管理').property('someProperty','2016')。property('someProperty','Offen')。property('someProperty','Dummy')。property('someProperty','EN')。property('someProperty','Industry')。property('someProperty','过程文档整个公司对ERP系统的深刻选择。']

for-each将执行所有查询

  foreach (string query in queries)
  {
            await gremlinClient.SubmitAsync<dynamic>(query);
  }

我得到的错误

服务器错误:\ r \ n \ nActivityId:2312f64f-b865-49cc-bb26-843d46313199 \ nExceptionType:RequestRateTooLargeException \ nExceptionMessage:\ r \ n \ tMessage:{\“ Errors \”:[\“请求率很大\ “]} \ r \ n \ tActivityId:157daf87-3238-4e1c-9a81-41bcd6d7c2e1,请求URI:/ apps / 413f848b-ce17-40fc-ad7f-14c0e21e9633 / services / 29abd22a-4e74-48c1-aab3-b311be968829 / partitions 9e4cb405-4f74-4d7f-8d12-26e79b910143 / replicas / 132142016542682221s /,RequestStats:\ r \ n \ tRequestStartTime:2019-10-24T09:27:38.2395067Z,RequestEndTime:2019-10-24T09:27:38.2395067Z,数量尝试的区域:1 \ r \ n \ tResponseTime:2019-10-24T09:27:38.2395067Z

这是一个简单的代码,我不明白该更改什么。

是否可以重试同一点的请求,或者以某种方式无法获得该错误或避免该错误

azure azure-cosmosdb gremlin gremlin-server azure-cosmosdb-gremlinapi
1个回答
0
投票

您收到的例外是Request*Rate*TooLargeException,这意味着您在短时间内提交了太多请求。

对于运行批量操作,应使用vendor specific tooling

© www.soinside.com 2019 - 2024. All rights reserved.