
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
Performance Analyzer是一款HTTP基准测试工具,能够从单个节点或分布式集群生成显著负载。它结合Elixir的能力,用于分析应用在不同并发场景下的行为。
shellmix do local.hex --force, local.rebar --force mix do deps.clean --unused, deps.get, deps.compile mix compile
打开并编辑config/performance.exs文件进行配置。
elixirimport Config config :perf_analyzer, url: "http://httpbin.org/get", request: %{ method: "GET", headers: [{"Content-Type", "application/json"}], # body: ~s|'{"data": "value"}'| --> 如果不使用数据集值 body: fn item -> # 用于数据集替换 ~s|'{"data": #{Enum.random(1..10)}, "key": "#{item.columnName}"}'| end }, execution: %{ steps: 5, increment: 1, duration: 2000, constant_load: false, dataset: "/Users/sample.csv", # dataset: :none, --> 如果不使用数据集 separator: "," }, distributed: :none, jmeter_report: true config :logger, level: :info
| 属性 | 描述 |
|---|---|
| url | 要测试的应用URL。确保两台机器之间有网络连接 |
| request | 配置HTTP方法、请求头和请求体 |
| steps | 测试的执行步数。每步增加increment中配置的并发数 |
| increment | 每步之后并发数的增量 |
| duration | 每步的持续时间(毫秒) |
| constant_load | 配置负载是否恒定,或使用增量来改变每步的并发数 |
| dataset | CSV数据集文件的路径 |
| separator | 数据集分隔符(, ; :) |
| distributed | 指示是从单个节点运行还是以分布式方式运行 |
| jmeter_report | 是否生成JMeter CSV格式报告 |
在上面的示例中,将执行一个包含5步、增量为50的测试:
每步将持续2秒。
shelldocker run --rm -v <项目路径>/config:/app/config -v <项目路径>/dataset:/app/datasets bancolombia/distributed-performance-analyzer:latest
shelliex -S mix # 或 iex --sname node1@localhost -S mix
elixiralias DistributedPerformanceAnalyzer.Domain.UseCase.ExecutionUseCase ExecutionUseCase.launch_execution()
shellmix release _build/prod/rel/distributed_performance_analyzer/bin/distributed_performance_analyzer start
每步执行后,将获得如下结果表格:
csvconcurrency, throughput, min latency (ms), mean latency (ms), max latency (ms), p90 latency (ms), p95 latency (ms), p99 latency (ms), http_mean_latency, http_max_latency, 2xx requests, 3xx requests, 4xx requests, 5xx requests, http_errors, total_errors, total_requests 1, 4.0, 27, 49.0, 71, 66.6, 68.8, 70.56, 49.0, 71, 2, 0, 0, 0, 0, 0, 2 2, 116.0, 12, 17.0, 33, 22.3, 24.0, 33.0, 17.0, 33, 58, 0, 0, 0, 0, 0, 58 3, 156.0, 12, 18.44, 28, 24.3, 25.15, 27.23, 18.44, 28, 78, 0, 0, 0, 0, 0, 78 4, 178.0, 12, 21.39, 50, 27.2, 47.0, 49.12, 21.39, 50, 89, 0, 0, 0, 0, 0, 89 5, 294.0, 12, 16.52, 32, 22.0, 24.4, 31.54, 16.52, 32, 147, 0, 0, 0, 0, 0, 147
csvtimeStamp,elapsed,label,responseCode,responseMessage,threadName,dataType,success,failureMessage,bytes,sentBytes,grpThreads,allThreads,URL,Latency,IdleTime,Connect 1694523851175,71,sample,200,OK,#PID<0.443.0>,,true,,24,0,1,1,GET -> http://localhost:8080/wait/10,70,0.0,400 1694523851246,27,sample,200,OK,#PID<0.443.0>,,true,,24,0,1,1,GET -> http://localhost:8080/wait/10,27,0.0,2 1694523851317,15,sample,200,OK,#PID<0.443.0>,,true,,24,0,2,2,GET -> http://localhost:8080/wait/10,15,0.0,0 1694523851317,15,sample,200,OK,#PID<0.444.0>,,true,,24,0,2,2,GET -> http://localhost:8080/wait/10,15,0.0,400 1694523851332,22,sample,200,OK,#PID<0.443.0>,,true,,24,0,2,2,GET -> http://localhost:8080/wait/10,22,0.0,0 1694523851332,22,sample,200,OK,#PID<0.444.0>,,true,,24,0,2,2,GET -> http://localhost:8080/wait/10,22,0.0,0 1694523851354,17,sample,200,OK,#PID<0.443.0>,,true,,24,0,2,2,GET -> http://localhost:8080/wait/10,17,0.0,0 1694523851354,17,sample,200,OK,#PID<0.444.0>,,true,,24,0,2,2,GET -> http://localhost:8080/wait/10,17,0.0,0 1694523851371,20,sample,200,OK,#PID<0.443.0>,,true,,24,0,2,2,GET -> http://localhost:8080/wait/10,20,0.0,0 1694523851371,20,sample,200,OK,#PID<0.444.0>,,true,,24,0,2,2,GET -> http://localhost:8080/wait/10,20,0.0,0
可根据需求比较关注的属性,例如并发与吞吐量、并发与平均延迟等指标。
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务