amazon-web-services - AWS ElastiCache redis 操作需要超过 10 毫秒

标签 amazon-web-services redis

我发现 AWS 弹性缓存 redis GET/SET 上的延迟非常高。使用一个 redis 实例 (cache.r3.2xlarge)。包括 set_type_commands、get_type_commands 和 hash_based_commands 在内的 redis 请求速率约为 3k rps。

SET 函数是一个简单的 SET 操作,而 GET 函数是 3 个命令(2 个 HGET 和 1 个 GET)的管道。如果我遗漏了什么,请告诉我。超过 10% 的 redis 请求花费的时间超过 10 毫秒。 AFAIK 3k rps 对于 redis 来说非常低,应该表现得更好。

在 SET 函数和 GET 函数上测量时间。

最佳答案

Cache.r3.2xlarge 是此类负载的一个非常昂贵的实例,响应时间不应超过 3-4 毫秒。

你应该做下面提到的事情:-

  1. 通过 cloudwatch 监控 Redis 实例.
  2. 检查 Redis 慢查询日志。

slowlog length

slowlog get 200
1) (integer) 13
   2) (integer) 1309448128
   3) (integer) 30
   4) 1) "slowlog"
      2) "get"
      3) "100"

将帮助您检查影响 Redis 整体性能的慢速查询。

通过它:- https://redis.io/commands/slowlog

关于amazon-web-services - AWS ElastiCache redis 操作需要超过 10 毫秒,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50384126/

相关文章:

ios - dynamodb,MobileHub 不工作

amazon-ec2 - 为什么我无法将弹性 IP 关联到 AWS 上第二个 VPC 中的 EC2 实例?

go - 从 Redis/Golang 客户端读取整个数据

django - 亚马逊 S3 + docker - "403 Forbidden: The difference between the request time and the current time is too large"

amazon-web-services - CloudFormation 部署应该通过 CI/CD 完成吗?

websocket - 从消费者外部收听 django channel channel_layer

node.js - 如何提供持久化的redis pubsub

python - 从celery后端(redis)获取数据

amazon-web-services - 安装在 EC2 服务器中时适用的 Amazon S3 Bucket 数据传输费用?

amazon-web-services - Redis 的 Lambda VPC 配置设置