简体   繁体   English

是否可以在Azure Portal的Redis控制台中获得redis基准?

[英]Is it possible to get redis-benchmark in Azure Portal's Redis Console?

I'm running redis cache in azure. 我正在天蓝色运行Redis缓存。 Azure Portal provides a console for the redis server to run redis commands ( get [key] works). Azure门户为redis服务器提供了一个控制台,以运行redis命令( get [key]有效)。 I wanted to use redis-benchmarks but its throwing an error: (error) ERR unknown command . 我想使用redis-benchmarks,但是它抛出一个错误: (error) ERR unknown command This is slightly confusing because Redis supposedly includes redis-benchmark . 这有点令人困惑,因为Redis据说包括redis-benchmark

Redis includes the redis-benchmark utility that simulates running commands done by N clients at the same time sending M total queries (it is similar to the Apache's ab utility). Redis包含redis-benchmark实用程序,该实用程序模拟N个客户端同时发送M个总计查询的正在运行的命令(类似于Apache的ab实用程序)。

Is there a way to get redis-benchmark to work? 有没有办法让redis基准发挥作用?

Here's an example command from the article: redis-benchmark -q -n 100000 这是文章中的示例命令: redis-benchmark -q -n 100000

You cannot run the redis-benchmark inside a redis-cli shell. 您不能在redis-cli shell中运行redis-benchmark It's not part of the redis commands. 它不是redis命令的一部分。 Try to run the redis-benchmark from a regular shell prompt instead. 尝试从常规的shell提示符下运行redis-benchmark。

Not working: 无法运作:

C:\>redis-cli
127.0.0.1:6379> redis-benchmark -t set,get -r 1000000 -q
(error) ERR unknown command 'redis-benchmark'

Working: 工作:

C:\>redis-benchmark -t set,get -r 1000000 -q
SET: 111856.82 requests per second
GET: 108225.10 requests per second

The Console in Azure only supports redis-cli. Azure中的控制台仅支持redis-cli。 To use Redis-benchmark, you need to turn on the non SSL port in Azure Redis Cache. 若要使用Redis基准,需要在Azure Redis缓存中打开非SSL端口。 More details are https://azure.microsoft.com/en-us/documentation/articles/cache-faq/#cache-commands 有关更多详细信息, 请访问https://azure.microsoft.com/zh-cn/documentation/articles/cache-faq/#cache-commands

You can also run these command from your local machine. 您也可以从本地计算机运行这些命令。 Check this link 检查此链接

You can use any of the commands listed at Redis commands except for the commands listed at Redis commands not supported in Azure Cache for Redis. 您可以使用Redis命令中列出的任何命令,Azure Cache for Redis中不支持的Redis命令中列出的命令除外。 You have several options to run Redis commands. 您可以使用多个选项来运行Redis命令。

  • If you have a Standard or Premium cache, you can run Redis commands using the Redis Console. 如果您具有标准或高级缓存,则可以使用Redis控制台运行Redis命令。 The Redis console provides a secure way to run Redis commands in the Azure portal. Redis控制台提供了一种在Azure门户中运行Redis命令的安全方式。
  • You can also use the Redis command-line tools. 您还可以使用Redis命令行工具。 To use them, perform the following steps: 要使用它们,请执行以下步骤:
  • Download the Redis command-line tools. 下载Redis命令行工具。
  • Connect to the cache using redis-cli.exe. 使用redis-cli.exe连接到缓存。 Pass in the cache endpoint using the -h switch and the key using -a as shown in the following example: redis-cli -h .redis.cache.windows.net -a 如下例所示,使用-h开关传递高速缓存端点,并使用-a传递密钥:redis-cli -h .redis.cache.windows.net -a

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM