快速开始

Rally是为Unix开发的,并已在Linux和MacOS上进行了很多测试。 Rally支持在Windows上运行的基准Elasticsearch集群,但是Rally本身需要安装在运行Unix的计算机上。

下载安装

安装Python 3.5+(包括pip3,git 1.9+)和对应的JDK以运行Elasticsearch。确保JAVA_HOME指向该JDK。然后运行以下命令,如有必要,可以使用sudo作为前缀:
pip3 install esrally 如果您有任何麻烦或需要更详细的说明,请参阅详细的安装指南。

配置

第一次运行rally的时候需要进行配置,如果使用默认配置的话直接执行 esrally configure

有关更多详细说明,请参阅配置指南。

进行第一次测试

下面让我们进行第一次测试

  1. esrally --distribution-version=6.5.3

这将下载Elasticsearch 6.5.3并对其运行Rally的默认track——the geonames(地名) track。比赛结束后,测试报告如下:

  1. ------------------------------------------------------
  2. _______ __ _____
  3. / ____(_)___ ____ _/ / / ___/_________ ________
  4. / /_ / / __ \/ __ `/ / \__ \/ ___/ __ \/ ___/ _ \
  5. / __/ / / / / / /_/ / / ___/ / /__/ /_/ / / / __/
  6. /_/ /_/_/ /_/\__,_/_/ /____/\___/\____/_/ \___/
  7. ------------------------------------------------------
  8. | Lap | Metric | Task | Value | Unit |
  9. |------:|----------------------------------------------------------------:|-----------------------:|----------:|--------:|
  10. | All | Cumulative indexing time of primary shards | | 54.5878 | min |
  11. | All | Min cumulative indexing time across primary shards | | 10.7519 | min |
  12. | All | Median cumulative indexing time across primary shards | | 10.9219 | min |
  13. | All | Max cumulative indexing time across primary shards | | 11.1754 | min |
  14. | All | Cumulative indexing throttle time of primary shards | | 0 | min |
  15. | All | Min cumulative indexing throttle time across primary shards | | 0 | min |
  16. | All | Median cumulative indexing throttle time across primary shards | | 0 | min |
  17. | All | Max cumulative indexing throttle time across primary shards | | 0 | min |
  18. | All | Cumulative merge time of primary shards | | 20.4128 | min |
  19. | All | Cumulative merge count of primary shards | | 136 | |
  20. | All | Min cumulative merge time across primary shards | | 3.82548 | min |
  21. | All | Median cumulative merge time across primary shards | | 4.1088 | min |
  22. | All | Max cumulative merge time across primary shards | | 4.38148 | min |
  23. | All | Cumulative merge throttle time of primary shards | | 1.17975 | min |
  24. | All | Min cumulative merge throttle time across primary shards | | 0.1169 | min |
  25. | All | Median cumulative merge throttle time across primary shards | | 0.26585 | min |
  26. | All | Max cumulative merge throttle time across primary shards | | 0.291033 | min |
  27. | All | Cumulative refresh time of primary shards | | 7.0317 | min |
  28. | All | Cumulative refresh count of primary shards | | 420 | |
  29. | All | Min cumulative refresh time across primary shards | | 1.37088 | min |
  30. | All | Median cumulative refresh time across primary shards | | 1.4076 | min |
  31. | All | Max cumulative refresh time across primary shards | | 1.43343 | min |
  32. | All | Cumulative flush time of primary shards | | 0.599417 | min |
  33. | All | Cumulative flush count of primary shards | | 10 | |
  34. | All | Min cumulative flush time across primary shards | | 0.0946333 | min |
  35. | All | Median cumulative flush time across primary shards | | 0.118767 | min |
  36. | All | Max cumulative flush time across primary shards | | 0.14145 | min |
  37. | All | Median CPU usage | | 284.4 | % |
  38. | All | Total Young Gen GC | | 12.868 | s |
  39. | All | Total Old Gen GC | | 3.803 | s |
  40. | All | Store size | | 3.17241 | GB |
  41. | All | Translog size | | 2.62736 | GB |
  42. | All | Index size | | 5.79977 | GB |
  43. | All | Total written | | 22.8536 | GB |
  44. | All | Heap used for segments | | 18.8885 | MB |
  45. | All | Heap used for doc values | | 0.0322647 | MB |
  46. | All | Heap used for terms | | 17.7184 | MB |
  47. | All | Heap used for norms | | 0.0723877 | MB |
  48. | All | Heap used for points | | 0.277171 | MB |
  49. | All | Heap used for stored fields | | 0.788307 | MB |
  50. | All | Segment count | | 94 | |
  51. | All | Min Throughput | index-append | 38089.5 | docs/s |
  52. | All | Median Throughput | index-append | 38613.9 | docs/s |
  53. | All | Max Throughput | index-append | 40693.3 | docs/s |
  54. | All | 50th percentile latency | index-append | 803.417 | ms |
  55. | All | 90th percentile latency | index-append | 1913.7 | ms |
  56. | All | 99th percentile latency | index-append | 3591.23 | ms |
  57. | All | 99.9th percentile latency | index-append | 6176.23 | ms |
  58. | All | 100th percentile latency | index-append | 6642.97 | ms |
  59. | All | 50th percentile service time | index-append | 803.417 | ms |
  60. | All | 90th percentile service time | index-append | 1913.7 | ms |
  61. | All | 99th percentile service time | index-append | 3591.23 | ms |
  62. | All | 99.9th percentile service time | index-append | 6176.23 | ms |
  63. | All | 100th percentile service time | index-append | 6642.97 | ms |
  64. | All | error rate | index-append | 0 | % |
  65. | All | ... | ... | ... | ... |
  66. | All | ... | ... | ... | ... |
  67. | All | Min Throughput | large_prohibited_terms | 2 | ops/s |
  68. | All | Median Throughput | large_prohibited_terms | 2 | ops/s |
  69. | All | Max Throughput | large_prohibited_terms | 2 | ops/s |
  70. | All | 50th percentile latency | large_prohibited_terms | 344.429 | ms |
  71. | All | 90th percentile latency | large_prohibited_terms | 353.187 | ms |
  72. | All | 99th percentile latency | large_prohibited_terms | 377.22 | ms |
  73. | All | 100th percentile latency | large_prohibited_terms | 392.918 | ms |
  74. | All | 50th percentile service time | large_prohibited_terms | 341.177 | ms |
  75. | All | 90th percentile service time | large_prohibited_terms | 349.979 | ms |
  76. | All | 99th percentile service time | large_prohibited_terms | 374.958 | ms |
  77. | All | 100th percentile service time | large_prohibited_terms | 388.62 | ms |
  78. | All | error rate | large_prohibited_terms | 0 | % |
  79. ----------------------------------
  80. [INFO] SUCCESS (took 1862 seconds)
  81. ----------------------------------

下一步

现在,您可以检查如何运行基准测试,更好地了解如何解释测试报告中的指标或创建自己的track。你也可以看一下提示和技巧,以帮助您了解如何解决Rally中的特定问题。