<legend id='piF6U'><style id='piF6U'><dir id='piF6U'><q id='piF6U'></q></dir></style></legend>
  • <tfoot id='piF6U'></tfoot>

        <i id='piF6U'><tr id='piF6U'><dt id='piF6U'><q id='piF6U'><span id='piF6U'><b id='piF6U'><form id='piF6U'><ins id='piF6U'></ins><ul id='piF6U'></ul><sub id='piF6U'></sub></form><legend id='piF6U'></legend><bdo id='piF6U'><pre id='piF6U'><center id='piF6U'></center></pre></bdo></b><th id='piF6U'></th></span></q></dt></tr></i><div id='piF6U'><tfoot id='piF6U'></tfoot><dl id='piF6U'><fieldset id='piF6U'></fieldset></dl></div>

        • <bdo id='piF6U'></bdo><ul id='piF6U'></ul>

        <small id='piF6U'></small><noframes id='piF6U'>

      1. 重复受限制的 DynamoDB 请求

        时间:2024-05-10

        <legend id='6hkUK'><style id='6hkUK'><dir id='6hkUK'><q id='6hkUK'></q></dir></style></legend>

          <tbody id='6hkUK'></tbody>
            <i id='6hkUK'><tr id='6hkUK'><dt id='6hkUK'><q id='6hkUK'><span id='6hkUK'><b id='6hkUK'><form id='6hkUK'><ins id='6hkUK'></ins><ul id='6hkUK'></ul><sub id='6hkUK'></sub></form><legend id='6hkUK'></legend><bdo id='6hkUK'><pre id='6hkUK'><center id='6hkUK'></center></pre></bdo></b><th id='6hkUK'></th></span></q></dt></tr></i><div id='6hkUK'><tfoot id='6hkUK'></tfoot><dl id='6hkUK'><fieldset id='6hkUK'></fieldset></dl></div>
          • <tfoot id='6hkUK'></tfoot>
          • <small id='6hkUK'></small><noframes id='6hkUK'>

              • <bdo id='6hkUK'></bdo><ul id='6hkUK'></ul>

                  本文介绍了重复受限制的 DynamoDB 请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在使用适用于 PHP 的 AWS 开发工具包以编程方式与 DynamoDB 交互.

                  I am using the AWS SDK for PHP to interact programmatically with DynamoDB.

                  我想检测对 DynamoDB 的请求是否受到限制,以便在短暂延迟后发出另一个请求.

                  I would like to detect if a request to DynamoDB has been throttled so another request can be made after a short delay.

                  现在,我在假设未满足受限制的请求的情况下进行操作.亚马逊常见问题解答 建议在发生限流时返回 400 错误.

                  Right now, I am operating under the assumption that throttled requests are not fulfilled. Amazon FAQs suggest that a 400 error is returned when throttling occurs.

                  所以我目前的逻辑看起来像这样:

                  So I currently have logic that looks something like this:

                  for( $i=0; $i<10; $i++ ) {
                  
                      $response = $dynamodb->get_item($get_item_args);
                  
                      if( $response->isOK() ) {
                  
                          break;
                  
                      } elseif( $i < 9 ) {
                  
                          sleep(1);
                      }
                  }
                  

                  我想这可行,但它是一个 bit 愚蠢.特别是,它将重复所有失败的请求,而不仅仅是受限制的请求.如果出现不可解决的错误,我真的不想重复请求.

                  I suppose this works, but it is a bit dumb. In particular, it will repeat all failed requests, not just throttled requests. If there is a non-resolvable error, I really don't want to repeat the request.

                  为了更智能,我想在一个受限制的响应中查看唯一标识符(即特定错误消息).但就我的一生而言,我无法捕获(或在 Internet 上的任何地方找到)样本限制响应.

                  To make this smarter, I'd like to look inside a throttled response for a unique identifier (i.e. a specific error message). But for the life of me, I can't capture (or find anywhere on the internet) a sample throttled response.

                  补偿限制风险和最大限度提高满足请求的可能性的最佳方法是什么?

                  What is the best way to compensate for the risk of throttling and maximize the likelihood of a fulfilled request?

                  推荐答案

                  事实证明,AWS SDK 会自动重试受限制的请求,直到成功.所以我上面的努力是不必要的(因为我使用的是 AWS SDK for PHP).

                  It turns out, the AWS SDKs will automatically retry throttled requests until success. So my efforts above are unneeded (since I am using the AWS SDK for PHP).

                  处理 Amazon DynamoDB 中的错误 文档页面对 ProvisionedThroughputExceededException 错误说如下:

                  The Handling Errors in Amazon DynamoDB documentation page says the following for the ProvisionedThroughputExceededException error:

                  适用于 Amazon DynamoDB 的 AWS 开发工具包自动重试请求收到此异常.所以,你的请求最终成功了,除非请求太大或您的重试队列太大而无法完成.

                  The AWS SDKs for Amazon DynamoDB automatically retry requests that receive this exception. So, your request is eventually successful, unless the request is too large or your retry queue is too large to finish.

                  这篇关于重复受限制的 DynamoDB 请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:使用 PHP 使用 AWS DynamoDB 进行分页 下一篇:如何在不指定主键的情况下从 DynamoDB 表中获取所有项目?

                  相关文章

                1. <i id='TUj5Y'><tr id='TUj5Y'><dt id='TUj5Y'><q id='TUj5Y'><span id='TUj5Y'><b id='TUj5Y'><form id='TUj5Y'><ins id='TUj5Y'></ins><ul id='TUj5Y'></ul><sub id='TUj5Y'></sub></form><legend id='TUj5Y'></legend><bdo id='TUj5Y'><pre id='TUj5Y'><center id='TUj5Y'></center></pre></bdo></b><th id='TUj5Y'></th></span></q></dt></tr></i><div id='TUj5Y'><tfoot id='TUj5Y'></tfoot><dl id='TUj5Y'><fieldset id='TUj5Y'></fieldset></dl></div>
                2. <tfoot id='TUj5Y'></tfoot>

                  • <bdo id='TUj5Y'></bdo><ul id='TUj5Y'></ul>

                  <legend id='TUj5Y'><style id='TUj5Y'><dir id='TUj5Y'><q id='TUj5Y'></q></dir></style></legend>

                      <small id='TUj5Y'></small><noframes id='TUj5Y'>