Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Apache Dubbo Competition Proposal] dubbo benchmark #14029

Open
wants to merge 3 commits into
base: 3.2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
70 changes: 70 additions & 0 deletions dubbo-benchmark-proposals/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# 自动化的 Dubbo 框架与协议性能基准 Benchmark 机制与平台使用手册

## 环境要求
* JDK 1.8 (执行benchmark程序)
* Maven (构建代码)
* ncat (用于探测端口是否开放)
* jq (用于处理benchmark结果)
* mycli (用于操作数据库)
* MySQL 8(存储benchmark结果)
* Grafana(展示benchmark结果)
* Kubernetes (用于部署)

## 目录说明
* asserts 截图资源
* docker 存放执行benchmark时所需的基础镜像构建Dockerfile
* grafana 存放benchmark的grafana dashboard
* kubernetes 存放kubernetes相关的yaml

## 使用方式
### 1. 先进入存放yaml的kubernetes目录,然后执行以下命令
````shell
kubectl apply -f pvc.yaml
kubectl apply -f infra.yaml
kubectl apply -f benchmark-shell.yaml
kubectl apply -f benchmark-cron.yaml
````
### 2. 初始化mysql benchmark数据库
通过以下命令找到mysql pod
````shell
kubectl get pod
````
通过以下命令进入mysql容器
````shell
kubectl exec -it [mysql pod] -- /bin/bash
````
进入mysql容器后通过以下命令连接mysql, 默认密码root
````shell
mysql -u root -p
````
导入schema.sql文件
````shell
use benchmark;
source /home/dev/schema.sql;
````


### 3. 访问Grafana
可通过以下命令获取Grafana的地址
````shell
kubectl get svc grafana
````

### 4. 导入benchmark dashboard
![usage-1](./assets/usage-1.png)
然后在浏览器中输入地址,用户名密码为admin/admin (默认的账号密码)

登入Grafana后按照以下步骤导入`grafana/benchmark-dashboard.json`面板
![usage-2](./assets/usage-2.png)
![usage-3](./assets/usage-3.png)

### 5. 等待kubernetes调度benchmark任务
经过一段时间的benchmark后,便可以看到以下结果
![image-1](./assets/image-1.png)







Binary file added dubbo-benchmark-proposals/assets/image-1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dubbo-benchmark-proposals/assets/image-2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dubbo-benchmark-proposals/assets/usage-1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dubbo-benchmark-proposals/assets/usage-2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dubbo-benchmark-proposals/assets/usage-3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions dubbo-benchmark-proposals/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM maven:3.6.3-adoptopenjdk-8
RUN sed -i 's/archive.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list
RUN useradd -ms /bin/bash dev
RUN usermod -aG sudo dev
RUN apt-get update && apt-get install -y \
vim \
ncat \
jq \
mycli

ENV HOME /home/dev
ENV MAVEN_CONFIG /home/dev/.m2
ENV USER_HOME_DIR /home/dev
USER dev
WORKDIR /home/dev
COPY ./settings.xml /usr/share/maven/conf/settings.xml
ENV PATH $JAVA_HOME/bin:$PATH