简体   繁体   English

在没有任何 CloudWatch 日志的情况下运行多个请求时 AWS API 网关出错

[英]Error on AWS API Gateway when running multiple requests without any CloudWatch logs

I'm using Artillery to run a small load test performance against a REST API (Edge endpoint) deployed with AWS API Gateway by using Serverless framework我正在使用Artillery通过无服务器框架针对使用 AWS API 网关部署的 REST API(边缘端点)运行小型负载测试性能

This API has a custom domain/ACM certificate configured and since I'm using Edge endpoint type it also has a CloudFront.此 API 配置了自定义域/ACM 证书,并且由于我使用的是 Edge 端点类型,它还有一个 CloudFront。

This is the flow for the request: Cloudfront -> API Gateway -> Lambda Authorizer -> Lambda -> Other services这是请求的流程: Cloudfront -> API Gateway -> Lambda Authorizer -> Lambda -> Other services

Once I start running around 100 requests/per second in a period of 60 seconds (total of 6000 requests) the results are fine (only HTTP 202) but when I start with 200 requests/per second (total of 12000 requests) I start getting some errors described in Artillery as "ETIMEDOUT".一旦我开始在 60 秒内每秒运行 100 个请求(总共 6000 个请求),结果就很好(只有 HTTP 202)但是当我以每秒 200 个请求(总共 12000 个请求)开始时,我开始得到一些错误在 Artillery 中被描述为“ETIMEDOUT”。 By looking into CloudWatch logs I couldn't find any error related to that and there I'm only able to visualize the successful requests.通过查看 CloudWatch 日志,我找不到任何与此相关的错误,而且我只能看到成功的请求。 I went through both lambdas metrics that are part of my flow and the metrics are only showing the number of successful invocations as well and no error on lambdas execution, eg no lambda timeout.我检查了作为流程一部分的两个 lambdas 指标,这些指标也只显示成功调用的次数,并且 lambdas 执行没有错误,例如没有 lambda 超时。

For example, on Artillery report I get 9666 successful responses and this value is the same I found for the lambda invocations.例如,在 Artillery 报告中,我得到 9666 个成功响应,这个值与我在 lambda 次调用中找到的值相同。

Artillery report (example):火炮报告(示例):

errors.ETIMEDOUT: .............................................................. 2334
http.codes.202: ................................................................ 9666
http.request_rate: ............................................................. 179/sec
http.requests: ................................................................. 12000
http.response_time:
  min: ......................................................................... 143
  max: ......................................................................... 601
  median: ...................................................................... 179.5
  p95: ......................................................................... 407.5
  p99: ......................................................................... 432.7
http.responses: ................................................................ 9666
vusers.completed: .............................................................. 9666
vusers.created: ................................................................ 12000
vusers.created_by_name.0: ...................................................... 12000
vusers.failed: ................................................................. 2334
vusers.session_length:
  min: ......................................................................... 190
  max: ......................................................................... 7530.3
  median: ...................................................................... 237.5
  p95: ......................................................................... 459.5
  p99: ......................................................................... 507.8

Note: There is no pattern on this "error" results.注意:此“错误”结果没有模式。 Each execution generates a different amount of "ETIMEDOUT" errors.每次执行都会产生不同数量的“ETIMEDOUT”错误。

Artillery yml test definition火炮 yml 测试定义

config:
  target: 'https://testing.mydomain.com'
  phases:
    - duration: 60
      arrivalRate: 200
  defaults:    
    headers:
      Authorization: 'Bearer XXXXXX'
scenarios:
  - flow:
    - post:
        url: "/create"
        json:
          clt: "{{ $randomString() }}"
          value: "10"
          prd: "abcdefg"
    log: "Sending info to {{ $randomString() }}"

By checking CloudWatch metrics for API Gateway, it seems only the successfull requests (9666 in the example above) are reaching the API. I'm checking the "count" metric:通过检查 API 网关的 CloudWatch 指标,似乎只有成功的请求(上例中的 9666)到达 API。我正在检查“计数”指标:

在此处输入图像描述 在此处输入图像描述

I'm wondering if there is any API limit that I couldn't find.我想知道是否有任何我找不到的 API 限制。

I believe you will be hitting this limit here potentially.我相信你可能会在这里达到这个限制。

https://docs.aws.amazon.com/apigateway/latest/developerguide/limits.html https://docs.aws.amazon.com/apigateway/latest/developerguide/limits.html

"10,000 requests per second (RPS) with an additional burst capacity provided by the token bucket algorithm, using a maximum bucket capacity of 5,000 requests. * Note The burst quota is determined by the API Gateway service team based on the overall RPS quota for the account in the Region. It is not a quota that a customer can control or request changes to." "10,000 请求/秒 (RPS) 加上令牌桶算法提供的额外突发容量,使用最大桶容量 5,000 请求。*注意突发配额由 API 网关服务团队根据整体 RPS 配额确定该地区的帐户。这不是客户可以控制或请求更改的配额。”

I could be wrong, but worth checking these limit sets.我可能是错的,但值得检查这些限制集。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 多个区域的 AWS CloudWatch 日志 - AWS CloudWatch logs in multiple regions 在 Raspberry Pi 4 上运行 AWS CloudWatch 日志代理 - Running AWS CloudWatch logs agent on Raspberry Pi 4 localstack aws cloudwatch 日志 - localstack Aws cloudwatch logs API网关与AWS Service CloudWatch集成时,如何设置调用的api版本? - How to set the api version being called in API Gateway when integrating with AWS Service CloudWatch? AWS API Gateway OPTIONS 请求返回 500 错误 - AWS API Gateway OPTIONS requests returns 500 error AWS CloudWatch 向 CloudWatch 发送日志但不发送自定义指标 - AWS CloudWatch sending logs but not custom metrics to CloudWatch AWS API 网关:如何在 cloudwatch 中记录 4XX 和 5XX 错误? 示例查找状态代码 413,请求实体太大错误是否记录在 Cloudwatch 中? - AWS API Gateway: How is 4XX and 5XX errors logged in cloudwatch? Example find Status Code 413, Request Entity too large error is logged in Cloudwatch? AWS ECS Fargate,将日志发送到多个目的地(CloudWatch Logs 和 Elasticsearch) - AWS ECS Fargate, send logs to multiple destinations (CloudWatch Logs and Elasticsearch) AWS cloudwatch API 金丝雀状态代码失败,即使记录(记录在 cloudwatch 日志中)状态代码为 200 - AWS cloudwatch API canary statuscode comes as failed even the logged(logged in cloudwatch logs) statusCode is 200 使用 AWS 放大时出现 502 网关错误,cloudwatch 在随机线路上给出错误? - 502 gateway error when utilizing AWS amplify, cloudwatch gives error on random line?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM