3.4. 运行 Hyperfoil 基准


使用 Hyperfoil 运行基准测试,以收集 Data Grid 集群的性能数据。

先决条件

  • 创建 Hyperfoil Operator 订阅。
  • 在 Red Hat OpenShift 上实例化 Hyperfoil Controller。

流程

  1. 创建基准测试。

    $ cat > hyperfoil-benchmark.yaml<<EOF
    name: hotrod-benchmark
    hotrod:
     # Replace <USERNAME>:<PASSWORD> with your Data Grid credentials.
     # Replace <SERVICE_HOSTNAME>:<PORT> with the host name and port for Data Grid.
     - uri: hotrod://<USERNAME>:<PASSWORD>@<SERVICE_HOSTNAME>:<PORT>
       caches:
        # Replace <CACHE-NAME> with the name of your Data Grid cache.
        - <CACHE-NAME>
    agents:
      agent-1:
      agent-2:
      agent-3:
      agent-4:
      agent-5:
    phases:
    - rampupPut:
        increasingRate:
          duration: 10s
          initialUsersPerSec: 100
          targetUsersPerSec: 200
          maxSessions: 300
          scenario: &put
          - putData:
            - randomInt: cacheKey <- 1 .. 40000
            - randomUUID: cacheValue
            - hotrodRequest:
                # Replace <CACHE-NAME> with the name of your Data Grid cache.
                put: <CACHE-NAME>
                key: key-${cacheKey}
                value: value-${cacheValue}
    - rampupGet:
        increasingRate:
          duration: 10s
          initialUsersPerSec: 100
          targetUsersPerSec: 200
          maxSessions: 300
          scenario: &get
          - getData:
            - randomInt: cacheKey <- 1 .. 40000
            - hotrodRequest:
                # Replace <CACHE-NAME> with the name of your Data Grid cache.
                get: <CACHE-NAME>
                key: key-${cacheKey}
    - doPut:
        constantRate:
          startAfter: rampupPut
          duration: 5m
          usersPerSec: 10000
          maxSessions: 11000
          scenario: *put
    - doGet:
        constantRate:
          startAfter: rampupGet
          duration: 5m
          usersPerSec: 40000
          maxSessions: 41000
          scenario: *get
    EOF
    Copy to Clipboard Toggle word wrap
  2. 在任意浏览器中打开路由,以访问 Hyperfoil CLI。
  3. 上传基准测试。

    1. 运行 上传 命令。

      [hyperfoil]$ upload
      Copy to Clipboard Toggle word wrap
    2. 点 Select benchmark 文件,然后导航到文件系统上的基准测试并上传该文件。
  4. 运行基准测试。

    [hyperfoil]$ run hotrod-benchmark
    Copy to Clipboard Toggle word wrap
  5. 获取基准测试成绩.

    [hyperfoil]$ stats
    Copy to Clipboard Toggle word wrap
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat