目录

前言

一、系统信息

1. 操作系统

2. CPU(虚拟机内)

3. 内存

二、编译wrk

1.什么时wrk

2.下载编译wrk

三、部署MariaDB

1. 安装MariaDB

2. 启动MariaDB服务

3. 修改root密码

4. 创建sbtest数据库、导入结构及数据

四、压测.NET Core 3.1项目

1. 部署项目

2. wrk压力测试

3. 停止服务

五、压测SpringBoot项目

1. 部署项目

2. wrk压力测试

3. 停止服务

总结



前言

本文介绍.NET Core WebApi与Java SpringBoot WebApi读取MySQL(MariaDB)在银河麒麟高级服务器操作系统V10上的性能差异


一、系统信息

1. 操作系统

# cat /etc/kylin-release
Kylin Linux Advanced Server release V10 (Azalea)

2. CPU(虚拟机内)

# lscpu
Architecture:          aarch64
Byte Order:            Little Endian
CPU(s):                8
On-line CPU(s) list:   0-7
Thread(s) per core:    1
Core(s) per socket:    8
座:                 1
NUMA 节点:         1
型号:              2
BogoMIPS:            100.00
NUMA 节点0 CPU:    0-7
Flags:                 fp asimd evtstrm crc32 cpuid

3. 内存

# free -htotal        used        free      shared  buff/cache   available
Mem:            15G        612M        3.2G         30M         11G         12G
Swap:          8.0G          0B        8.0G

二、编译wrk

1.什么时wrk

wrk 是一个比较先进的 HTTP 压力测试工具,当在单个多核 CPU 上运行时,能够产生大量负载。它结合了多线程设计和可扩展的事件通知系统,例如 epoll 和 kqueue。

可选的 LuaJIT 脚本可以执行 HTTP 请求生成,响应处理和自定义报告。

2.下载编译wrk

# wget https://github.com/wg/wrk/archive/4.1.0.tar.gz
# tar -xvf 4.1.0.tar.gz
# cd wrk-4.1.0/
# make -j8
# ll
总用量 3000
-rw-rw-r-- 1 root root     945 1月  21 2018 CHANGES
drwxrwxr-x 2 root root      68 1月  21 2018 deps
-rw-rw-r-- 1 root root     916 1月  21 2018 INSTALL
-rw-rw-r-- 1 root root   10489 1月  21 2018 LICENSE
-rw-rw-r-- 1 root root    2751 1月  21 2018 Makefile
-rw-rw-r-- 1 root root    5420 1月  21 2018 NOTICE
drwxr-xr-x 8 root root     291 11月 16 10:10 obj
-rw-rw-r-- 1 root root    3497 1月  21 2018 README.md
-rw-rw-r-- 1 root root    4158 1月  21 2018 SCRIPTING
drwxrwxr-x 2 root root     161 1月  21 2018 scripts
drwxrwxr-x 2 root root    4096 1月  21 2018 src
-rwxr-xr-x 1 root root 3051272 11月 16 10:10 wrk

三、部署MariaDB

1. 安装MariaDB

# yum install mariadb mariadb-server -y
已加载插件:langpacks
正在解决依赖关系
--> 正在检查事务
---> 软件包 mariadb.aarch64.1.5.5.60-1.el7_5 将被 安装
--> 正在处理依赖关系 mariadb-libs(aarch-64) = 1:5.5.60-1.el7_5,它被软件包 1:mariadb-5.5.60-1.el7_5.aarch64 需要
---> 软件包 mariadb-server.aarch64.1.5.5.60-1.el7_5 将被 安装
--> 正在处理依赖关系 perl-DBD-MySQL,它被软件包 1:mariadb-server-5.5.60-1.el7_5.aarch64 需要
--> 正在检查事务
---> 软件包 mariadb-libs.aarch64.1.5.5.60-1.el7_5 将被 安装
---> 软件包 perl-DBD-MySQL.aarch64.0.4.023-6.el7 将被 安装
--> 解决依赖关系完成依赖关系解决=====================================================================================================================================================================================================================================================================================Package                                                              架构                                                          版本                                                                     源                                                                 大小
=====================================================================================================================================================================================================================================================================================
正在安装:mariadb                                                              aarch64                                                       1:5.5.60-1.el7_5                                                         ks10-adv-os                                                       8.4 Mmariadb-server                                                       aarch64                                                       1:5.5.60-1.el7_5                                                         ks10-adv-os                                                        11 M
为依赖而安装:mariadb-libs                                                         aarch64                                                       1:5.5.60-1.el7_5                                                         ks10-adv-os                                                       740 kperl-DBD-MySQL                                                       aarch64                                                       4.023-6.el7                                                              ks10-adv-os                                                       136 k事务概要
=====================================================================================================================================================================================================================================================================================
安装  2 软件包 (+2 依赖软件包)总下载量:20 M
安装大小:113 M
Downloading packages:
(1/4): mariadb-libs-5.5.60-1.el7_5.aarch64.rpm                                                                                                                                                                                                                | 740 kB  00:00:00
(2/4): mariadb-5.5.60-1.el7_5.aarch64.rpm                                                                                                                                                                                                                     | 8.4 MB  00:00:05
(3/4): perl-DBD-MySQL-4.023-6.el7.aarch64.rpm                                                                                                                                                                                                                 | 136 kB  00:00:00
(4/4): mariadb-server-5.5.60-1.el7_5.aarch64.rpm                                                                                                                                                                                                              |  11 MB  00:00:06
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
总计                                                                                                                                                                                                                                                 2.8 MB/s |  20 MB  00:00:07
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction正在安装    : 1:mariadb-libs-5.5.60-1.el7_5.aarch64                                                                                                                                                                                                                            1/4
/sbin/ldconfig: /lib64/libstdc++.so.6.0.21-gdb.py 不是 ELF 文件 - 它起始的魔数错误。正在安装    : 1:mariadb-5.5.60-1.el7_5.aarch64                                                                                                                                                                                                                                 2/4 正在安装    : perl-DBD-MySQL-4.023-6.el7.aarch64                                                                                                                                                                                                                               3/4 正在安装    : 1:mariadb-server-5.5.60-1.el7_5.aarch64                                                                                                                                                                                                                          4/4 验证中      : 1:mariadb-5.5.60-1.el7_5.aarch64                                                                                                                                                                                                                                 1/4 验证中      : 1:mariadb-server-5.5.60-1.el7_5.aarch64                                                                                                                                                                                                                          2/4 验证中      : 1:mariadb-libs-5.5.60-1.el7_5.aarch64                                                                                                                                                                                                                            3/4 验证中      : perl-DBD-MySQL-4.023-6.el7.aarch64                                                                                                                                                                                                                               4/4 已安装:mariadb.aarch64 1:5.5.60-1.el7_5                                                                                                      mariadb-server.aarch64 1:5.5.60-1.el7_5                                                                                                     作为依赖被安装:mariadb-libs.aarch64 1:5.5.60-1.el7_5                                                                                                     perl-DBD-MySQL.aarch64 0:4.023-6.el7                                                                                                    完毕!

2. 启动MariaDB服务

# systemctl enable mariadb --now
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.

3. 修改root密码

# mysql -uroot
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 2
Server version: 5.5.60-MariaDB MariaDB ServerCopyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.MariaDB [(none)]> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -ADatabase changed
MariaDB [mysql]> update user set password=password('abcDEF123___') where user='root';
Query OK, 4 rows affected (0.00 sec)
Rows matched: 4  Changed: 4  Warnings: 0MariaDB [mysql]> flush privileges;
Query OK, 0 rows affected (0.00 sec)MariaDB [mysql]>

4. 创建sbtest数据库、导入结构及数据

下载数据库文件

# wget https://github.com/hknarutofk/KylinV10Performance/releases/download/v1.0/schema.sql
--2020-11-16 10:50:04--  https://github.com/hknarutofk/KylinV10Performance/releases/download/v1.0/schema.sql
正在解析主机 github.com (github.com)... 13.250.177.223
正在连接 github.com (github.com)|13.250.177.223|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 302 Found
位置:https://github-production-release-asset-2e65be.s3.amazonaws.com/313153611/8c0d8100-27f8-11eb-9401-3725410e51d0?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20201116%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20201116T025005Z&X-Amz-Expires=300&X-Amz-Signature=be1bf6d5512d3a2e0035d130d109b8383d3d899a3eecdaec28ea3a1df5c0a04c&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=313153611&response-content-disposition=attachment%3B%20filename%3Dschema.sql&response-content-type=application%2Foctet-stream [跟随至新的 URL]
--2020-11-16 10:50:06--  https://github-production-release-asset-2e65be.s3.amazonaws.com/313153611/8c0d8100-27f8-11eb-9401-3725410e51d0?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20201116%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20201116T025005Z&X-Amz-Expires=300&X-Amz-Signature=be1bf6d5512d3a2e0035d130d109b8383d3d899a3eecdaec28ea3a1df5c0a04c&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=313153611&response-content-disposition=attachment%3B%20filename%3Dschema.sql&response-content-type=application%2Foctet-stream
正在解析主机 github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)... 52.217.81.44
正在连接 github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)|52.217.81.44|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:432 [application/octet-stream]
正在保存至: “schema.sql”100%[===========================================================================================================================================================================================================================================>] 432         --.-K/s 用时 0s      2020-11-16 10:50:07 (13.1 MB/s) - 已保存 “schema.sql” [432/432])

创建并导入数据库

[root@192-168-110-185 ~]# mysql -uroot -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 5.5.60-MariaDB MariaDB ServerCopyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.MariaDB [(none)]> create database sbtest;
Query OK, 1 row affected (0.00 sec)MariaDB [(none)]> use sbtest;
Database changed
MariaDB [sbtest]> source /root/schema.sql;
Query OK, 0 rows affected, 1 warning (0.00 sec)Query OK, 0 rows affected (0.10 sec)Query OK, 0 rows affected (0.00 sec)Query OK, 2 rows affected (0.01 sec)
Records: 2  Duplicates: 0  Warnings: 0Query OK, 0 rows affected (0.00 sec)MariaDB [sbtest]>

四、压测.NET Core 3.1项目

1. 部署项目

下载release版本

[root@192-168-110-185 ~]# wget https://github.com/hknarutofk/KylinV10Performance/releases/download/v1.0/publish.zip
--2020-11-16 10:53:35--  https://github.com/hknarutofk/KylinV10Performance/releases/download/v1.0/publish.zip
正在解析主机 github.com (github.com)... 13.229.188.59
正在连接 github.com (github.com)|13.229.188.59|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 302 Found
位置:https://github-production-release-asset-2e65be.s3.amazonaws.com/313153611/40f36e00-27f8-11eb-8469-d02ef1d50209?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20201116%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20201116T025336Z&X-Amz-Expires=300&X-Amz-Signature=f1acae8c474d51483709a3021fca30ab3ba159cf6837f2843e1576a39fef6c1d&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=313153611&response-content-disposition=attachment%3B%20filename%3Dpublish.zip&response-content-type=application%2Foctet-stream [跟随至新的 URL]
--2020-11-16 10:53:36--  https://github-production-release-asset-2e65be.s3.amazonaws.com/313153611/40f36e00-27f8-11eb-8469-d02ef1d50209?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20201116%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20201116T025336Z&X-Amz-Expires=300&X-Amz-Signature=f1acae8c474d51483709a3021fca30ab3ba159cf6837f2843e1576a39fef6c1d&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=313153611&response-content-disposition=attachment%3B%20filename%3Dpublish.zip&response-content-type=application%2Foctet-stream
正在解析主机 github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)... 52.217.0.107
正在连接 github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)|52.217.0.107|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:3938641 (3.8M) [application/octet-stream]
正在保存至: “publish.zip”100%[===========================================================================================================================================================================================================================================>] 3,938,641   18.8KB/s 用时 3m 6s  2020-11-16 10:56:43 (20.7 KB/s) - 已保存 “publish.zip” [3938641/3938641])

unzip解压

# unzip publish.zip
Archive:  publish.zipcreating: publish/inflating: publish/BouncyCastle.Crypto.dll  inflating: publish/Google.Protobuf.dll  inflating: publish/K4os.Compression.LZ4.Streams.dll  inflating: publish/K4os.Compression.LZ4.dll  inflating: publish/K4os.Hash.xxHash.dll  inflating: publish/Microsoft.Bcl.AsyncInterfaces.dll  inflating: publish/Microsoft.Bcl.HashCode.dll  inflating: publish/Microsoft.EntityFrameworkCore.Abstractions.dll  inflating: publish/Microsoft.EntityFrameworkCore.Relational.dll  inflating: publish/Microsoft.EntityFrameworkCore.dll  inflating: publish/Microsoft.Extensions.Caching.Abstractions.dll  inflating: publish/Microsoft.Extensions.Caching.Memory.dll  inflating: publish/Microsoft.Extensions.Configuration.Abstractions.dll  inflating: publish/Microsoft.Extensions.Configuration.Binder.dll  inflating: publish/Microsoft.Extensions.Configuration.dll  inflating: publish/Microsoft.Extensions.DependencyInjection.Abstractions.dll  inflating: publish/Microsoft.Extensions.DependencyInjection.dll  inflating: publish/Microsoft.Extensions.Logging.Abstractions.dll  inflating: publish/Microsoft.Extensions.Logging.dll  inflating: publish/Microsoft.Extensions.Options.dll  inflating: publish/Microsoft.Extensions.Primitives.dll  inflating: publish/MySql.Data.EntityFrameworkCore.dll  inflating: publish/MySql.Data.dll  inflating: publish/MySqlConnector.dll  inflating: publish/Newtonsoft.Json.dll  inflating: publish/Pomelo.EntityFrameworkCore.MySql.dll  inflating: publish/Pomelo.JsonObject.dll  inflating: publish/Renci.SshNet.dll  inflating: publish/SshNet.Security.Cryptography.dll  inflating: publish/System.Collections.Immutable.dll  inflating: publish/System.Configuration.ConfigurationManager.dll  inflating: publish/System.Diagnostics.DiagnosticSource.dll  inflating: publish/System.Security.Cryptography.ProtectedData.dll  inflating: publish/System.Xml.XPath.XmlDocument.dll  inflating: publish/Ubiety.Dns.Core.dll  inflating: publish/WebApplication1.deps.json  inflating: publish/WebApplication1.dll  inflating: publish/WebApplication1.exe  inflating: publish/WebApplication1.pdb  inflating: publish/WebApplication1.runtimeconfig.json  inflating: publish/Zstandard.Net.dll  inflating: publish/appsettings.Development.json  inflating: publish/appsettings.json  creating: publish/runtimes/creating: publish/runtimes/win/creating: publish/runtimes/win/lib/creating: publish/runtimes/win/lib/netstandard2.0/inflating: publish/runtimes/win/lib/netstandard2.0/System.Security.Cryptography.ProtectedData.dll  inflating: publish/web.config     

进入工作目录、启动项目

# cd publish/
# dotnet WebApplication1.dll  --urls=http://0.0.0.0:5000
info: Microsoft.Hosting.Lifetime[0]Now listening on: http://0.0.0.0:5000
info: Microsoft.Hosting.Lifetime[0]Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]Hosting environment: Production
info: Microsoft.Hosting.Lifetime[0]Content root path: /root/publish

2. wrk压力测试

# ./wrk -t100 -c100 -d1m http://0.0.0.0:5000/api/values
Running 1m test @ http://0.0.0.0:5000/api/values100 threads and 100 connectionsThread Stats   Avg      Stdev     Max   +/- StdevLatency    34.39ms   15.19ms 301.10ms   84.94%Req/Sec    29.63      9.05   130.00     47.95%169526 requests in 1.00m, 38.48MB readSocket errors: connect 0, read 0, write 0, timeout 100
Requests/sec:   2821.30
Transfer/sec:    655.73KB

3. 停止服务

在dotnet启动终端输入快捷键Ctrl+C终止进程

# dotnet WebApplication1.dll  --urls=http://0.0.0.0:5000
info: Microsoft.Hosting.Lifetime[0]Now listening on: http://0.0.0.0:5000
info: Microsoft.Hosting.Lifetime[0]Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]Hosting environment: Production
info: Microsoft.Hosting.Lifetime[0]Content root path: /root/publish
^Cinfo: Microsoft.Hosting.Lifetime[0]Application is shutting down...

五、压测SpringBoot项目

1. 部署项目

下载release版本

# wget https://github.com/hknarutofk/KylinV10Performance/releases/download/v1.0/demo-0.0.1-SNAPSHOT.jar
--2020-11-16 11:03:31--  https://github.com/hknarutofk/KylinV10Performance/releases/download/v1.0/demo-0.0.1-SNAPSHOT.jar
正在解析主机 github.com (github.com)... 13.229.188.59
正在连接 github.com (github.com)|13.229.188.59|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 302 Found
位置:https://github-production-release-asset-2e65be.s3.amazonaws.com/313153611/4355c800-27f8-11eb-9390-d597be7c8634?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20201116%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20201116T030331Z&X-Amz-Expires=300&X-Amz-Signature=a54d923999272a2ab42dc284e489f7b1203a1b996b91e68845c4a5e9337d5a28&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=313153611&response-content-disposition=attachment%3B%20filename%3Ddemo-0.0.1-SNAPSHOT.jar&response-content-type=application%2Foctet-stream [跟随至新的 URL]
--2020-11-16 11:03:31--  https://github-production-release-asset-2e65be.s3.amazonaws.com/313153611/4355c800-27f8-11eb-9390-d597be7c8634?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20201116%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20201116T030331Z&X-Amz-Expires=300&X-Amz-Signature=a54d923999272a2ab42dc284e489f7b1203a1b996b91e68845c4a5e9337d5a28&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=313153611&response-content-disposition=attachment%3B%20filename%3Ddemo-0.0.1-SNAPSHOT.jar&response-content-type=application%2Foctet-stream
正在解析主机 github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)... 52.216.134.251
正在连接 github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)|52.216.134.251|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:24772535 (24M) [application/octet-stream]
正在保存至: “demo-0.0.1-SNAPSHOT.jar”100%[===========================================================================================================================================================================================================================================>] 24,772,535  5.15MB/s 用时 4.6s   2020-11-16 11:03:37 (5.15 MB/s) - 已保存 “demo-0.0.1-SNAPSHOT.jar” [24772535/24772535])

启动项目

# java -jar demo-0.0.1-SNAPSHOT.jar .   ____          _            __ _ _/\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \\\/  ___)| |_)| | | | | || (_| |  ) ) ) )'  |____| .__|_| |_|_| |_\__, | / / / /=========|_|==============|___/=/_/_/_/:: Spring Boot ::        (v2.3.4.RELEASE)2020-11-16 11:04:40.357 [main] INFO  Tomcat initialized with port(s): 8888 (http) o.s.b.w.e.t.TomcatWebServer.initialize(TomcatWebServer.java:108)
2020-11-16 11:04:40.393 [main] INFO  Initializing ProtocolHandler ["http-nio-8888"] o.a.c.h.Http11NioProtocol.log(DirectJDKLog.java:173)
2020-11-16 11:04:40.396 [main] INFO  Starting service [Tomcat] o.a.c.c.StandardService.log(DirectJDKLog.java:173)
2020-11-16 11:04:40.397 [main] INFO  Starting Servlet engine: [Apache Tomcat/9.0.38] o.a.c.c.StandardEngine.log(DirectJDKLog.java:173)
2020-11-16 11:04:40.563 [main] INFO  Initializing Spring embedded WebApplicationContext o.a.c.c.C.[.[.[/].log(DirectJDKLog.java:173)
2020-11-16 11:04:40.565 [main] INFO  Root WebApplicationContext: initialization completed in 3450 ms o.s.b.w.s.c.ServletWebServerApplicationContext.prepareWebApplicationContext(ServletWebServerApplicationContext.java:285)_ _   |_  _ _|_. ___ _ |    _
| | |\/|_)(_| | |_\  |_)||_|_\ /               |         3.3.1
2020-11-16 11:04:42.694 [main] INFO  Initializing ExecutorService 'applicationTaskExecutor' o.s.s.c.ThreadPoolTaskExecutor.initialize(ExecutorConfigurationSupport.java:181)
2020-11-16 11:04:43.220 [main] INFO  Starting ProtocolHandler ["http-nio-8888"] o.a.c.h.Http11NioProtocol.log(DirectJDKLog.java:173)
2020-11-16 11:04:43.279 [main] INFO  Tomcat started on port(s): 8888 (http) with context path '' o.s.b.w.e.t.TomcatWebServer.start(TomcatWebServer.java:220)

2. wrk压力测试

# ./wrk -t100 -c100 -d1m http://0.0.0.0:8888/main/sbtest1/values
Running 1m test @ http://0.0.0.0:8888/main/sbtest1/values100 threads and 100 connectionsThread Stats   Avg      Stdev     Max   +/- StdevLatency    49.72ms  162.60ms   1.98s    96.84%Req/Sec    58.70     38.25   343.00     64.84%324741 requests in 1.00m, 63.24MB readSocket errors: connect 0, read 0, write 0, timeout 3
Requests/sec:   5403.26
Transfer/sec:      1.05MB

3. 停止服务

在java启动终端输入快捷键Ctrl+C终止进程

# java -jar demo-0.0.1-SNAPSHOT.jar .   ____          _            __ _ _/\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \\\/  ___)| |_)| | | | | || (_| |  ) ) ) )'  |____| .__|_| |_|_| |_\__, | / / / /=========|_|==============|___/=/_/_/_/:: Spring Boot ::        (v2.3.4.RELEASE)2020-11-16 11:04:40.357 [main] INFO  Tomcat initialized with port(s): 8888 (http) o.s.b.w.e.t.TomcatWebServer.initialize(TomcatWebServer.java:108)
2020-11-16 11:04:40.393 [main] INFO  Initializing ProtocolHandler ["http-nio-8888"] o.a.c.h.Http11NioProtocol.log(DirectJDKLog.java:173)
2020-11-16 11:04:40.396 [main] INFO  Starting service [Tomcat] o.a.c.c.StandardService.log(DirectJDKLog.java:173)
2020-11-16 11:04:40.397 [main] INFO  Starting Servlet engine: [Apache Tomcat/9.0.38] o.a.c.c.StandardEngine.log(DirectJDKLog.java:173)
2020-11-16 11:04:40.563 [main] INFO  Initializing Spring embedded WebApplicationContext o.a.c.c.C.[.[.[/].log(DirectJDKLog.java:173)
2020-11-16 11:04:40.565 [main] INFO  Root WebApplicationContext: initialization completed in 3450 ms o.s.b.w.s.c.ServletWebServerApplicationContext.prepareWebApplicationContext(ServletWebServerApplicationContext.java:285)_ _   |_  _ _|_. ___ _ |    _
| | |\/|_)(_| | |_\  |_)||_|_\ /               |         3.3.1
2020-11-16 11:04:42.694 [main] INFO  Initializing ExecutorService 'applicationTaskExecutor' o.s.s.c.ThreadPoolTaskExecutor.initialize(ExecutorConfigurationSupport.java:181)
2020-11-16 11:04:43.220 [main] INFO  Starting ProtocolHandler ["http-nio-8888"] o.a.c.h.Http11NioProtocol.log(DirectJDKLog.java:173)
2020-11-16 11:04:43.279 [main] INFO  Tomcat started on port(s): 8888 (http) with context path '' o.s.b.w.e.t.TomcatWebServer.start(TomcatWebServer.java:220)
2020-11-16 11:06:27.647 [http-nio-8888-exec-78] INFO  Initializing Spring DispatcherServlet 'dispatcherServlet' o.a.c.c.C.[.[.[/].log(DirectJDKLog.java:173)
2020-11-16 11:06:27.657 [http-nio-8888-exec-78] INFO  Initializing Servlet 'dispatcherServlet' o.s.w.s.DispatcherServlet.initServletBean(FrameworkServlet.java:525)
2020-11-16 11:06:27.678 [http-nio-8888-exec-78] INFO  Completed initialization in 20 ms o.s.w.s.DispatcherServlet.initServletBean(FrameworkServlet.java:547)
^C2020-11-16 11:07:43.629 [SpringContextShutdownHook] INFO  Shutting down ExecutorService 'applicationTaskExecutor' o.s.s.c.ThreadPoolTaskExecutor.shutdown(ExecutorConfigurationSupport.java:218)

总结

相同业务操作,通过http请求,业务服务器读取mysql,返回数据性能对比如下

  请求/s
.NET Core 3.1 WebApi 2821.3
SpringBoot RestController 5403.26

项目源码地址:https://github.com/hknarutofk/KylinV10Performance

银河麒麟高级服务器操作系统V10上.NET Core与Java相同类型MySQL(MariaDB) WebApi简单性能对比相关推荐

  1. 银河麒麟高级服务器操作系统V10上安装k8s单机集群

    前言 本文介绍银河麒麟高级服务器操作系统V10上安装部署k8s单机集群及一些基础的kubectl指令 本文涉及部署脚本主要源自基于https://github.com/easzlab/kubeasz在 ...

  2. 银河麒麟高级服务器操作系统V10上编译安装vscode失败的艰辛历程

    确认预装git即python版本 编译安装nods.js(非编译安装的node.js,yarn指令运行会崩溃!) sudo dnf install python gcc-c++ make 下载源码 执 ...

  3. 【Linux operation 23】Win 10 64位(X86 架构CPU)安装ARM架构的虚拟机(银河麒麟高级服务器操作系统 V10)

    1.银河麒麟高级服务器操作系统 V10(鲲鹏版)下载: 官网下载 https://www.kylinos.cn/scheme/server/1.html 1.银河麒麟高级服务器操作系统V10x86/兆 ...

  4. 银河麒麟高级服务器操作系统V10——LVM创建与使用

    银河麒麟高级服务器操作系统V10--LVM创建与使用 fdisk -l 查看当前分区表信息 fdisk 新增一块 2 TB 分区并个性 ID 为 8e fdisk和lsblk 查看最新分区信息 将物理 ...

  5. VMware 安装 银河麒麟高级服务器操作系统 V10 + QT 开发环境搭建

    下载并安装vmware 下载银河麒麟操作烯烃服务器版v10的镜像文件 从官网下载,因为是x86的电脑芯片,选择AMD64版,即 vmare 安装麒麟操作系统 注意事项: 安装位置选择自动分区 网络和主 ...

  6. 银河麒麟高级服务器操作系统V10 SP2安装人大金仓V8R6数据库

    目录 1.安装环境配置 1.1配置本地yum源 1.2同步本地时间 1.3配置本地环境 2.安装依赖关系 3.安装数据库 1.安装环境配置 1.1配置本地yum源 [root@kylintest2 ~ ...

  7. window10下安装银河麒麟高级服务器操作系统(飞腾版)V10

    1.系统镜像 2.安装虚拟机 坑:我们经常使用的电脑CPU是x86架构的,然后我们安装x86架构的64位处理器的操作系统直接使用VMware等虚拟软件进行虚拟,而对与不同的CPU架构的arm架构的操作 ...

  8. 银河麒麟高级服务器操作系统V10SP1 - ISO镜像定制 + KickStart自动化安装

    文章目录 一.基础环境搭建 1. 原始ISO获取 2. 系统安装 二.ISO镜像定制 1. 准备工作 2. 修改ISO镜像 3. 生成ISO镜像: 三.ISO镜像验证 一.基础环境搭建 1. 原始IS ...

  9. 银河麒麟高级服务器操作系统V10SP2安装JDK

    JDK是Java语言的软件开发工具包,是整个java开发的核心,它包含了JAVA的运行环境(Java运行环境Java Runtime Environment,简称JRE)和JAVA工具. JDK与Op ...

  10. 银河麒麟高级服务器操作系统(飞腾版)V10

    镜像太大无法上传,只有放网盘了 链接:https://pan.baidu.com/s/1cK2GAzViME11cTbO7_S2Vw  提取码:bu6p

最新文章

  1. 1521 error1
  2. 使用消息队列实现分布式事务-公认较为理想的分布式事务解决方案(转)
  3. 项目管理九大知识体系:
  4. python分片操作_【python原理解析】python中分片的实现原理及使用技巧
  5. 【CVPR2020 image caption】读Meshed-Memory Transformer for Image Captioning
  6. boost::hana::lift用法的测试程序
  7. MySQL中间件之ProxySQL(14):ProxySQL+PXC
  8. Android 智能指针 视频,Android系统智能指针中轻量级指针
  9. qq java版与wp版区别_手机QQ 2.7 (WP版)更新,同时支持WP7和WP8
  10. [literature]地下铁文本
  11. VB删除带子文件夹和文件的文件夹
  12. MySQL服务端恶意读取客户端文件漏洞 (DDCTF2019和国赛均涉及到这个漏洞)
  13. 数据结构银行叫号系统
  14. iSlide(PPT增强插件)官方正式版V5.6.1 | islide插件下载ppt插件在哪里下载?
  15. Cadence PSpice 仿真0:绘制电路图方法图文教程
  16. 免费版企业级杀毒软件mcafee使用报告。
  17. DP动态规划之背包问题(一)
  18. php避免超卖,thinkphp防止超卖
  19. matlab初值的非线性最小二乘,Matlab与Mathematica在非线性拟合中的应用比较
  20. 使用spire.doc for java为word添加页码、文字水印、书签(去除警告信息)

热门文章

  1. xThunder —— 完美支持Firefox的迅雷,旋风调用扩展
  2. java 熄灯问题_Java算法应用之熄灯问题解决
  3. Deeplink最全解析
  4. 【加法器】——模拟电路设计简单的二进制数加法器
  5. 文件拒绝访问且无法显示当前所有者
  6. java输出流 拒绝访问_java – 使用FileOutputStream时拒绝访问
  7. LIFT: Learned Invariant Feature Transform 论文解读
  8. 理财 股票 K线分析
  9. 一根网线连接两台电脑
  10. 利用会员积分系统提升会员复购率的要点