sysbench

一、sysbench介绍

1、sysbench简介

sysBench是一个模块化的、跨平台、多线程基准测试工具,主要用于评估测试各种不同系统参数下的数据库负载情况。sysbench提供如下测试:
(1)CPU性能
(2)磁盘IO性能
(3)调度程序性能
(4)内存分配及传输速度 
(5)POSIX线程性能
(6)数据库性能(OLTP基准测试)      
sysbench支持 MySQL、PostgreSQL、Oracle 数据库。

2、sysbench安装

Build构建依赖安装:

yum -y install make automake libtool pkgconfig libaio-devel
yum -y install mariadb-devel openssl-devel
yum -y install postgresql-devel

源码下载:
git clone https://github.com/akopytov/sysbench.git
生成配置工具:
autogen.sh
配置选项:
–with-pgsql:支持PostgreSQL
–with-oracle:支持Oracle
–without-mysql:无MySQL支持
configure [options]
编译:
make -j
安装:
make install

3、sysbench命令

sysbench [options]... [testname] [command]
testname是sysbench要执行的测试类型,可选项包括fileio、cpu、memory、threads、mutex,可以使用–test参数指定。
command是sysbench要执行的命令,包括prepare、run、cleanup,prepare为测试准备数据,run执行正式测试,cleanup在测试完成后对数据库进行清理。
sysbench通用参数选项如下:
–threads: 线程数,若设置为2,则sysbench会启动2个线程,同时分别进行素数的计算,默认值为1。
–time: 运行时长,单位秒。若设置为5,则sysbench会在5秒内循环进行素数计算,每完成一轮就是一个event,默认值为10。
–events: event上限次数,若设置为100,则表示当完成100次event后,即使时间富余也停止运行。默认值为0,则表示不限event次数。
–forced-shutdown=STRING:超时强制中断,默认为off。 --thread-stack-size=SIZE:线程栈大小,默认64K
–thread-init-timeout=N:线程初始化等待时间,默认为30秒
–rate=N:平均事务率,0表示不限制,默认为0。
–report-interval=N:测试进度报告输出的时间间隔,0表示关闭,默认为0。
–report-checkpoints=[LIST,…]:转储完全统计信息并在指定时间点复位所有计数器,参数是逗号分隔值的列表,表示从必须执行报告检查点的测试开始所经过的时间(以秒为单位)。 默认情况下,报告检查点处于关闭状态[off]。
–debug[=on|off]:打印调试信息,默认为off
–validate[=on|off]:尽可能执行验证检查,默认为off。
–help[=on|off]:打印help信息并退出,默认为off
–version[=on|off]:打印版本信息并退出,默认为off
–config-file=FILENAME:命令行选项文件
–luajit-cmd=STRING:执行LuaJIT控制命令

二、CPU性能基准测试

1、命令选项

sysbench --test=cpu help
–cpu-max-prime:素数生成数量的上限,若设置为3,则表示2、3、5(要计算1-5共5次),默认值为10000。

2、CPU性能测试

sysbench cpu --cpu-max-prime=20000 --threads=8 --time=30 run

Prime numbers limit: 20000,每个线程产生的素数上限均为2000
events per second: 650.7,所有线程每秒完成了650.74次event
total time: 10.0017s,共耗时10秒
total number of events: 6510,10秒内所有线程一共完成了6510次event
min: 3.03,完成1次event的最少耗时3.03秒
avg: 3.07,所有event的平均耗时3.07毫秒
max: 3.27,完成1次event的最多耗时3.27毫秒
95th percentile: 3.13, 95%次event在3.13秒毫秒内完成
sum: 19999.91,每个线程耗时10秒,2个线程叠加耗时就是20秒
events (avg/stddev): 3255.0000/44.00 // 平均每个线程完成3255次event,标准差为44
execution time (avg/stddev): 10.0000/0.00 // 每个线程平均耗时10秒,标准差为0

三、OLTP基准测试

1、命令选项

sysbench --test=oltp help
–oltp-test-mode=STRING:测试模式,simple、complex、nontrx、sp,默认为complex。
–oltp-reconnect-mode=STRING:重连接模式,session不使用重连接,transaction在每次事务结束后重连接,query在每个SQL语句执行完重连接,random对于每个事务随机选择重连接模式,默认为session。
–oltp-sp-name=STRING:存储过程名称,默认为空
–oltp-read-only=[on|off]:只读模式。Update、delete、insert语句不可执行,默认为off
–oltp-skip-trx=[on|off]:省略begin/commit语句,默认为off。
–oltp-range-size=N:查询范围,默认为100。–oltp-point-selects=N:number of point selects [10]
–oltp-simple-ranges=N          number of simple ranges [1]
–oltp-sum-ranges=N             number of sum ranges [1]
–oltp-order-ranges=N           number of ordered ranges [1]
–oltp-distinct-ranges=N        number of distinct ranges [1]
–oltp-index-updates=N          number of index update [1]
–oltp-non-index-updates=N      number of non-index updates [1]
–oltp-nontrx-mode=STRING   查询类型对于非事务执行模式{select, update_key, update_nokey, insert, delete} [select]
–oltp-auto-inc=[on|off]      AUTO_INCREMENT是否开启。默认是on
–oltp-connect-delay=N     在多少微秒后连接数据库。默认是10000
–oltp-user-delay-min=N    每个请求最短等待时间。单位是ms。默认是0
–oltp-user-delay-max=N    每个请求最长等待时间。单位是ms。默认是0
–oltp-table-name=STRING  测试时使用到的表名。默认是sbtest
–oltp-table-size=N         测试表的记录数。默认是10000
–oltp-dist-type=STRING    分布的随机数{uniform(均匀分布),Gaussian(高斯分布),special(空间分布)}。默认是special
–oltp-dist-iter=N    产生数的迭代次数。默认是12
–oltp-dist-pct=N    值的百分比被视为’special’ (for special distribution)。默认是1
–oltp-dist-res=N    ‘special’的百分比值。默认是75

2、Lua脚本

/usr/share/sysbench/bulk_insert.lua
/usr/share/sysbench/oltp_common.lua
/usr/share/sysbench/oltp_delete.lua
/usr/share/sysbench/oltp_insert.lua
/usr/share/sysbench/oltp_point_select.lua
/usr/share/sysbench/oltp_read_only.lua
/usr/share/sysbench/oltp_read_write.lua
/usr/share/sysbench/oltp_update_index.lua
/usr/share/sysbench/oltp_update_non_index.lua
/usr/share/sysbench/oltp_write_only.lua
/usr/share/sysbench/select_random_points.lua
/usr/share/sysbench/select_random_ranges.lua

3、准备数据

sysbench ./tests/include/oltp_legacy/oltp.lua --mysql-host=192.168.10.10 --mysql-port=3306 --mysql-user=root --mysql-password=123456 --oltp-test-mode=complex --oltp-tables-count=10 --oltp-table-size=100000 --threads=10 --time=120 --report-interval=10 prepare
执行模式为complex,使用了10个表,每个表有10万条数据,客户端的并发线程数为10,执行时间为120秒,每10秒生成一次报告。

4、执行测试

sysbench ./tests/include/oltp_legacy/oltp.lua --mysql-host=192.168.10.10 --mysql-port=3306 --mysql-user=root --mysql-password=123456 --oltp-test-mode=complex --oltp-tables-count=10 --oltp-table-size=100000 --threads=10 --time=120 --report-interval=10 run >> /home/test/mysysbench.log

5、清理数据

sysbench ./tests/include/oltp_legacy/oltp.lua --mysql-host=192.168.10.10 --mysql-port=3306 --mysql-user=root --mysql-password=123456 cleanup

四、MySQL测试

  • MySQL数据库准备,版本为8.0.30
# su - mysql
$ mysqld &
...$ mysql -uroot -proot2023
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 8.0.30-22 Percona Server (GPL), Release 22, Revision 7e301439b65Copyright (c) 2009-2022 Percona LLC and/or its affiliates
Copyright (c) 2000, 2022, Oracle and/or its affiliates.Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.00 sec)

准备连接用户和数据库test

--创建可以远程连接的root用户
mysql> select user,host from mysql.user;
+------------------+-----------+
| user             | host      |
+------------------+-----------+
| mysql.infoschema | localhost |
| mysql.session    | localhost |
| mysql.sys        | localhost |
| root             | localhost |
+------------------+-----------+
4 rows in set (0.00 sec)mysql> create user 'root'@'%' identified  with mysql_native_password by 'root2023';
Query OK, 0 rows affected (0.01 sec)mysql> grant all privileges on *.* to 'root'@'%';
Query OK, 0 rows affected (0.00 sec)--准备test数据库
$ mysql -h<MYSQL_IP地址> -P3306 -uroot -proot2023
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 16
Server version: 8.0.30-22 Percona Server (GPL), Release 22, Revision 7e301439b65Copyright (c) 2009-2022 Percona LLC and/or its affiliates
Copyright (c) 2000, 2022, Oracle and/or its affiliates.Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql> create database test;
Query OK, 1 row affected (0.01 sec)

场景:4张表,每张表个10万行,16线程 - 点查 oltp_point_select

--表准备
# cd share/sysbench
# sysbench --threads=16 --time=60 --report-interval=1 oltp_common.lua --mysql-host=66.3.125.125 --mysql-port=3306 --mysql-user=root --mysql-password=root2023 \
--mysql-db=test --tables=4 --table-size=100000 prepare
sysbench 1.0.20 (using bundled LuaJIT 2.1.0-beta2)Initializing worker threads...Creating table 'sbtest2'...
Creating table 'sbtest1'...
Creating table 'sbtest4'...
Creating table 'sbtest3'...
Inserting 100000 records into 'sbtest1'
Inserting 100000 records into 'sbtest2'
Inserting 100000 records into 'sbtest3'
Inserting 100000 records into 'sbtest4'
Creating a secondary index on 'sbtest1'...
Creating a secondary index on 'sbtest4'...
Creating a secondary index on 'sbtest3'...
Creating a secondary index on 'sbtest2'...--连接数据库确认
mysql> use test;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -ADatabase changed
mysql> show tables;
+----------------+
| Tables_in_test |
+----------------+
| sbtest1        |
| sbtest2        |
| sbtest3        |
| sbtest4        |
+----------------+
4 rows in set (0.00 sec)mysql> select count(*) from test1;
ERROR 1146 (42S02): Table 'test.test1' doesn't exist
mysql> select count(*) from sbtest1;
+----------+
| count(*) |
+----------+
|   100000 |
+----------+
1 row in set (0.01 sec)mysql> desc sbtest2;
+-------+-----------+------+-----+---------+----------------+
| Field | Type      | Null | Key | Default | Extra          |
+-------+-----------+------+-----+---------+----------------+
| id    | int       | NO   | PRI | NULL    | auto_increment |
| k     | int       | NO   | MUL | 0       |                |
| c     | char(120) | NO   |     |         |                |
| pad   | char(60)  | NO   |     |         |                |
+-------+-----------+------+-----+---------+----------------+
4 rows in set (0.00 sec)mysql> show create table sbtest3;
+---------+------------------------------------------------------------------------------------------------------------------------------------+
| Table   | Create Table                                                                                                                                                                                                                                                                                             |
+---------+------------------------------------------------------------------------------------------------------------------------------------+
| sbtest3 | CREATE TABLE `sbtest3` (`id` int NOT NULL AUTO_INCREMENT,`k` int NOT NULL DEFAULT '0',`c` char(120) NOT NULL DEFAULT '',`pad` char(60) NOT NULL DEFAULT '',PRIMARY KEY (`id`),KEY `k_3` (`k`)
) ENGINE=InnoDB AUTO_INCREMENT=100001 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci |
+---------+------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)mysql> select * from sbtest4 limit 5;
+----+-------+-------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------+
| id | k     | c                                                                                                                       | pad                                                         |
+----+-------+-------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------+
|  1 | 50303 | 18034632456-32298647298-82351096178-60420120042-90070228681-93395382793-96740777141-18710455882-88896678134-41810932745 | 43683718329-48150560094-43449649167-51455516141-06448225399 |
|  2 | 50450 | 69708345057-48265944193-91002879830-11554672482-35576538285-03657113365-90301319612-18462263634-56608104414-27254248188 | 05603373460-16140454933-50476449060-04937808333-32421752305 |
|  3 | 50940 | 04940100707-79196214653-69899219520-16993366471-57789899414-92525293502-62890351877-80720493586-13749767421-91023911663 | 67126402466-45286595358-58204691523-62355769941-06673789329 |
|  4 | 49974 | 00224676656-38003697255-44184401985-68851502665-32480635416-18445090402-63317915144-45481704416-01982644758-64592914637 | 77377062042-10834277926-21379893425-70248821993-50926412030 |
|  5 | 49825 | 62628403457-54953268488-99818997311-93464095661-99772044635-92164943209-17521494984-21945783042-38536244491-28083888401 | 55908867377-87072757393-05794355403-55852568630-13599576089 |
+----+-------+-------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------+
5 rows in set (0.00 sec)--60秒点查测试
# sysbench --threads=16 --time=60 --report-interval=1 oltp_point_select  --mysql-host=66.3.125.125 --mysql-port=3306 --mysql-user=root --mysql-password=root2023 \
--mysql-db=test --tables=4 --table-size=100000 run
sysbench 1.0.20 (using bundled LuaJIT 2.1.0-beta2)Running the test with following options:
Number of threads: 16
Report intermediate results every 1 second(s)
Initializing random number generator from current timeInitializing worker threads...Threads started!--此处结果内容主要包含: 时间计数(1s意为1秒)、thds为线程数、tps为每秒事务数、qps为每秒查询数、r/w/o分别代表每秒的读/写/其他操作数
--lat(ms, 95%)时95%操作的耗时-单位为毫秒、err/s是每秒的错误数、reconn/s是每秒的重连数[ 1s ] thds: 16 tps: 26905.31 qps: 26905.31 (r/w/o: 26905.31/0.00/0.00) lat (ms,95%): 0.65 err/s: 0.00 reconn/s: 0.00
[ 2s ] thds: 16 tps: 29389.04 qps: 29389.04 (r/w/o: 29389.04/0.00/0.00) lat (ms,95%): 0.72 err/s: 0.00 reconn/s: 0.00
[ 3s ] thds: 16 tps: 30498.78 qps: 30498.78 (r/w/o: 30498.78/0.00/0.00) lat (ms,95%): 0.68 err/s: 0.00 reconn/s: 0.00
[ 4s ] thds: 16 tps: 22776.97 qps: 22776.97 (r/w/o: 22776.97/0.00/0.00) lat (ms,95%): 1.27 err/s: 0.00 reconn/s: 0.00
[ 5s ] thds: 16 tps: 30643.61 qps: 30643.61 (r/w/o: 30643.61/0.00/0.00) lat (ms,95%): 0.67 err/s: 0.00 reconn/s: 0.00
[ 6s ] thds: 16 tps: 22722.25 qps: 22722.25 (r/w/o: 22722.25/0.00/0.00) lat (ms,95%): 1.21 err/s: 0.00 reconn/s: 0.00
[ 7s ] thds: 16 tps: 31585.17 qps: 31585.17 (r/w/o: 31585.17/0.00/0.00) lat (ms,95%): 0.64 err/s: 0.00 reconn/s: 0.00
[ 8s ] thds: 16 tps: 30296.85 qps: 30296.85 (r/w/o: 30296.85/0.00/0.00) lat (ms,95%): 0.68 err/s: 0.00 reconn/s: 0.00
[ 9s ] thds: 16 tps: 23705.46 qps: 23705.46 (r/w/o: 23705.46/0.00/0.00) lat (ms,95%): 0.90 err/s: 0.00 reconn/s: 0.00
[ 10s ] thds: 16 tps: 30879.22 qps: 30879.22 (r/w/o: 30879.22/0.00/0.00) lat (ms,95%): 0.67 err/s: 0.00 reconn/s: 0.00
[ 11s ] thds: 16 tps: 22564.61 qps: 22564.61 (r/w/o: 22564.61/0.00/0.00) lat (ms,95%): 0.95 err/s: 0.00 reconn/s: 0.00
[ 12s ] thds: 16 tps: 30561.08 qps: 30561.08 (r/w/o: 30561.08/0.00/0.00) lat (ms,95%): 0.67 err/s: 0.00 reconn/s: 0.00
[ 13s ] thds: 16 tps: 28261.06 qps: 28261.06 (r/w/o: 28261.06/0.00/0.00) lat (ms,95%): 0.73 err/s: 0.00 reconn/s: 0.00
[ 14s ] thds: 16 tps: 21548.61 qps: 21548.61 (r/w/o: 21548.61/0.00/0.00) lat (ms,95%): 1.18 err/s: 0.00 reconn/s: 0.00
[ 15s ] thds: 16 tps: 27673.56 qps: 27673.56 (r/w/o: 27673.56/0.00/0.00) lat (ms,95%): 0.74 err/s: 0.00 reconn/s: 0.00
[ 16s ] thds: 16 tps: 20636.60 qps: 20636.60 (r/w/o: 20636.60/0.00/0.00) lat (ms,95%): 1.27 err/s: 0.00 reconn/s: 0.00
[ 17s ] thds: 16 tps: 27885.83 qps: 27885.83 (r/w/o: 27885.83/0.00/0.00) lat (ms,95%): 0.73 err/s: 0.00 reconn/s: 0.00
[ 18s ] thds: 16 tps: 28684.66 qps: 28685.66 (r/w/o: 28685.66/0.00/0.00) lat (ms,95%): 0.74 err/s: 0.00 reconn/s: 0.00
[ 19s ] thds: 16 tps: 25480.74 qps: 25479.74 (r/w/o: 25479.74/0.00/0.00) lat (ms,95%): 0.84 err/s: 0.00 reconn/s: 0.00
[ 20s ] thds: 16 tps: 30483.03 qps: 30483.03 (r/w/o: 30483.03/0.00/0.00) lat (ms,95%): 0.68 err/s: 0.00 reconn/s: 0.00
[ 21s ] thds: 16 tps: 22042.51 qps: 22042.51 (r/w/o: 22042.51/0.00/0.00) lat (ms,95%): 1.25 err/s: 0.00 reconn/s: 0.00
[ 22s ] thds: 16 tps: 30604.82 qps: 30604.82 (r/w/o: 30604.82/0.00/0.00) lat (ms,95%): 0.67 err/s: 0.00 reconn/s: 0.00
[ 23s ] thds: 16 tps: 29589.29 qps: 29589.29 (r/w/o: 29589.29/0.00/0.00) lat (ms,95%): 0.70 err/s: 0.00 reconn/s: 0.00
[ 24s ] thds: 16 tps: 24282.99 qps: 24282.99 (r/w/o: 24282.99/0.00/0.00) lat (ms,95%): 0.86 err/s: 0.00 reconn/s: 0.00
[ 25s ] thds: 16 tps: 31246.92 qps: 31246.92 (r/w/o: 31246.92/0.00/0.00) lat (ms,95%): 0.64 err/s: 0.00 reconn/s: 0.00
[ 26s ] thds: 16 tps: 22876.61 qps: 22876.61 (r/w/o: 22876.61/0.00/0.00) lat (ms,95%): 1.08 err/s: 0.00 reconn/s: 0.00
[ 27s ] thds: 16 tps: 31529.39 qps: 31529.39 (r/w/o: 31529.39/0.00/0.00) lat (ms,95%): 0.64 err/s: 0.00 reconn/s: 0.00
[ 28s ] thds: 16 tps: 29517.51 qps: 29517.51 (r/w/o: 29517.51/0.00/0.00) lat (ms,95%): 0.69 err/s: 0.00 reconn/s: 0.00
[ 29s ] thds: 16 tps: 26343.56 qps: 26343.56 (r/w/o: 26343.56/0.00/0.00) lat (ms,95%): 0.89 err/s: 0.00 reconn/s: 0.00
[ 30s ] thds: 16 tps: 31113.37 qps: 31113.37 (r/w/o: 31113.37/0.00/0.00) lat (ms,95%): 0.67 err/s: 0.00 reconn/s: 0.00
[ 31s ] thds: 16 tps: 24066.86 qps: 24066.86 (r/w/o: 24066.86/0.00/0.00) lat (ms,95%): 0.83 err/s: 0.00 reconn/s: 0.00
[ 32s ] thds: 16 tps: 30315.40 qps: 30315.40 (r/w/o: 30315.40/0.00/0.00) lat (ms,95%): 0.68 err/s: 0.00 reconn/s: 0.00
[ 33s ] thds: 16 tps: 29995.12 qps: 29995.12 (r/w/o: 29995.12/0.00/0.00) lat (ms,95%): 0.69 err/s: 0.00 reconn/s: 0.00
[ 34s ] thds: 16 tps: 23322.28 qps: 23322.28 (r/w/o: 23322.28/0.00/0.00) lat (ms,95%): 0.94 err/s: 0.00 reconn/s: 0.00
[ 35s ] thds: 16 tps: 30676.67 qps: 30677.67 (r/w/o: 30677.67/0.00/0.00) lat (ms,95%): 0.65 err/s: 0.00 reconn/s: 0.00
[ 36s ] thds: 16 tps: 23831.21 qps: 23831.21 (r/w/o: 23831.21/0.00/0.00) lat (ms,95%): 1.01 err/s: 0.00 reconn/s: 0.00
[ 37s ] thds: 16 tps: 31442.98 qps: 31441.98 (r/w/o: 31441.98/0.00/0.00) lat (ms,95%): 0.64 err/s: 0.00 reconn/s: 0.00
[ 38s ] thds: 16 tps: 29257.83 qps: 29257.83 (r/w/o: 29257.83/0.00/0.00) lat (ms,95%): 0.69 err/s: 0.00 reconn/s: 0.00
[ 39s ] thds: 16 tps: 24508.15 qps: 24508.15 (r/w/o: 24508.15/0.00/0.00) lat (ms,95%): 0.99 err/s: 0.00 reconn/s: 0.00
[ 40s ] thds: 16 tps: 30816.09 qps: 30816.09 (r/w/o: 30816.09/0.00/0.00) lat (ms,95%): 0.67 err/s: 0.00 reconn/s: 0.00
[ 41s ] thds: 16 tps: 23236.84 qps: 23236.84 (r/w/o: 23236.84/0.00/0.00) lat (ms,95%): 0.95 err/s: 0.00 reconn/s: 0.00
[ 42s ] thds: 16 tps: 29849.10 qps: 29849.10 (r/w/o: 29849.10/0.00/0.00) lat (ms,95%): 0.70 err/s: 0.00 reconn/s: 0.00
[ 43s ] thds: 16 tps: 29130.52 qps: 29130.52 (r/w/o: 29130.52/0.00/0.00) lat (ms,95%): 0.73 err/s: 0.00 reconn/s: 0.00
[ 44s ] thds: 16 tps: 23340.17 qps: 23340.17 (r/w/o: 23340.17/0.00/0.00) lat (ms,95%): 0.86 err/s: 0.00 reconn/s: 0.00
[ 45s ] thds: 16 tps: 29494.52 qps: 29494.52 (r/w/o: 29494.52/0.00/0.00) lat (ms,95%): 0.69 err/s: 0.00 reconn/s: 0.00
[ 46s ] thds: 16 tps: 22966.11 qps: 22966.11 (r/w/o: 22966.11/0.00/0.00) lat (ms,95%): 0.83 err/s: 0.00 reconn/s: 0.00
[ 47s ] thds: 16 tps: 30129.21 qps: 30129.21 (r/w/o: 30129.21/0.00/0.00) lat (ms,95%): 0.67 err/s: 0.00 reconn/s: 0.00
[ 48s ] thds: 16 tps: 29165.29 qps: 29165.29 (r/w/o: 29165.29/0.00/0.00) lat (ms,95%): 0.70 err/s: 0.00 reconn/s: 0.00
[ 49s ] thds: 16 tps: 23268.56 qps: 23268.56 (r/w/o: 23268.56/0.00/0.00) lat (ms,95%): 0.97 err/s: 0.00 reconn/s: 0.00
[ 50s ] thds: 16 tps: 30788.20 qps: 30788.20 (r/w/o: 30788.20/0.00/0.00) lat (ms,95%): 0.65 err/s: 0.00 reconn/s: 0.00
[ 51s ] thds: 16 tps: 19082.94 qps: 19082.94 (r/w/o: 19082.94/0.00/0.00) lat (ms,95%): 2.03 err/s: 0.00 reconn/s: 0.00
[ 52s ] thds: 16 tps: 29830.84 qps: 29830.84 (r/w/o: 29830.84/0.00/0.00) lat (ms,95%): 0.72 err/s: 0.00 reconn/s: 0.00
[ 53s ] thds: 16 tps: 29476.39 qps: 29476.39 (r/w/o: 29476.39/0.00/0.00) lat (ms,95%): 0.70 err/s: 0.00 reconn/s: 0.00
[ 54s ] thds: 16 tps: 23153.58 qps: 23153.58 (r/w/o: 23153.58/0.00/0.00) lat (ms,95%): 0.95 err/s: 0.00 reconn/s: 0.00
[ 55s ] thds: 16 tps: 29153.81 qps: 29153.81 (r/w/o: 29153.81/0.00/0.00) lat (ms,95%): 0.70 err/s: 0.00 reconn/s: 0.00
[ 56s ] thds: 16 tps: 23450.91 qps: 23450.91 (r/w/o: 23450.91/0.00/0.00) lat (ms,95%): 0.90 err/s: 0.00 reconn/s: 0.00
[ 57s ] thds: 16 tps: 30307.30 qps: 30307.30 (r/w/o: 30307.30/0.00/0.00) lat (ms,95%): 0.67 err/s: 0.00 reconn/s: 0.00
[ 58s ] thds: 16 tps: 29204.35 qps: 29204.35 (r/w/o: 29204.35/0.00/0.00) lat (ms,95%): 0.70 err/s: 0.00 reconn/s: 0.00
[ 59s ] thds: 16 tps: 21223.78 qps: 21223.78 (r/w/o: 21223.78/0.00/0.00) lat (ms,95%): 1.18 err/s: 0.00 reconn/s: 0.00--SQL统计信息,SQL的读/写/其他/总计次数、总事务数及每秒事务数、总查询数及每秒查询数、忽略错误数据、重新数据SQL statistics:queries performed:read:                            1637657write:                           0other:                           0total:                           1637657transactions:                        1637657 (27292.23 per sec.)queries:                             1637657 (27292.23 per sec.)ignored errors:                      0      (0.00 per sec.)reconnects:                          0      (0.00 per sec.)--通用统计信息:总时间、总操作数General statistics:total time:                          60.0026stotal number of events:              1637657--耗时信息(单位毫秒):最小、平均、最大、95%耗时、总耗时Latency (ms):min:                                    0.35avg:                                    0.59max:                                   19.8195th percentile:                        0.75sum:                               959077.57Threads fairness:events (avg/stddev):           102353.5625/5226.65execution time (avg/stddev):   59.9423/0.00

场景:4张表,每张表个10万行,16线程 - 读写 oltp_read_write

--60秒读写
# sysbench --threads=16 --time=60 --report-interval=1 oltp_read_write  --mysql-host=66.3.125.125 --mysql-port=3306 --mysql-user=root --mysql-password=root2023 \
--mysql-db=test --tables=4 --table-size=100000 run
sysbench 1.0.20 (using bundled LuaJIT 2.1.0-beta2)Running the test with following options:
Number of threads: 16
Report intermediate results every 1 second(s)
Initializing random number generator from current timeInitializing worker threads...Threads started!--此处结果内容主要包含: 时间计数(1s意为1秒)、thds为线程数、tps为每秒事务数、qps为每秒查询数、r/w/o分别代表每秒的读/写/其他操作数
--lat(ms, 95%)时95%操作的耗时-单位为毫秒、err/s是每秒的错误数、reconn/s是每秒的重连数[ 1s ] thds: 16 tps: 850.05 qps: 17191.55 (r/w/o: 12053.34/3422.15/1716.06) lat (ms,95%): 27.17 err/s: 0.00 reconn/s: 0.00
[ 2s ] thds: 16 tps: 811.05 qps: 16189.10 (r/w/o: 11340.77/3227.22/1621.11) lat (ms,95%): 44.17 err/s: 0.00 reconn/s: 0.00
[ 3s ] thds: 16 tps: 1101.64 qps: 22027.85 (r/w/o: 15419.00/4404.57/2204.28) lat (ms,95%): 16.71 err/s: 0.00 reconn/s: 0.00
[ 4s ] thds: 16 tps: 1075.49 qps: 21530.73 (r/w/o: 15073.81/4305.95/2150.97) lat (ms,95%): 17.32 err/s: 0.00 reconn/s: 0.00
[ 5s ] thds: 16 tps: 801.10 qps: 16045.97 (r/w/o: 11236.38/3208.39/1601.20) lat (ms,95%): 52.89 err/s: 0.00 reconn/s: 0.00
[ 6s ] thds: 16 tps: 1082.76 qps: 21662.30 (r/w/o: 15165.71/4330.06/2166.53) lat (ms,95%): 17.32 err/s: 0.00 reconn/s: 0.00
[ 7s ] thds: 16 tps: 761.08 qps: 15211.66 (r/w/o: 10649.16/3042.33/1520.17) lat (ms,95%): 49.21 err/s: 0.00 reconn/s: 0.00
[ 8s ] thds: 16 tps: 1076.98 qps: 21531.62 (r/w/o: 15056.74/4319.92/2154.96) lat (ms,95%): 17.95 err/s: 0.00 reconn/s: 0.00
[ 9s ] thds: 16 tps: 1066.95 qps: 21302.97 (r/w/o: 14914.28/4254.79/2133.90) lat (ms,95%): 17.63 err/s: 0.00 reconn/s: 0.00
[ 10s ] thds: 16 tps: 681.07 qps: 13618.31 (r/w/o: 9528.91/2730.26/1359.13) lat (ms,95%): 69.29 err/s: 0.00 reconn/s: 0.00
[ 11s ] thds: 16 tps: 1112.85 qps: 22264.06 (r/w/o: 15586.94/4448.41/2228.71) lat (ms,95%): 17.01 err/s: 0.00 reconn/s: 0.00
[ 12s ] thds: 16 tps: 752.84 qps: 15131.86 (r/w/o: 10579.81/3045.37/1506.69) lat (ms,95%): 58.92 err/s: 0.00 reconn/s: 0.00
[ 13s ] thds: 16 tps: 1098.32 qps: 21904.34 (r/w/o: 15351.44/4356.26/2196.64) lat (ms,95%): 17.32 err/s: 0.00 reconn/s: 0.00
[ 14s ] thds: 16 tps: 970.85 qps: 19442.90 (r/w/o: 13609.83/3891.38/1941.69) lat (ms,95%): 19.29 err/s: 0.00 reconn/s: 0.00
[ 15s ] thds: 16 tps: 773.18 qps: 15459.62 (r/w/o: 10828.53/3084.72/1546.36) lat (ms,95%): 59.99 err/s: 0.00 reconn/s: 0.00
[ 16s ] thds: 16 tps: 1062.01 qps: 21222.24 (r/w/o: 14842.17/4256.05/2124.02) lat (ms,95%): 19.29 err/s: 0.00 reconn/s: 0.00
[ 17s ] thds: 16 tps: 712.95 qps: 14246.94 (r/w/o: 9980.26/2840.79/1425.89) lat (ms,95%): 59.99 err/s: 0.00 reconn/s: 0.00
[ 18s ] thds: 16 tps: 1053.95 qps: 21143.99 (r/w/o: 14800.29/4235.80/2107.90) lat (ms,95%): 19.65 err/s: 0.00 reconn/s: 0.00
[ 19s ] thds: 16 tps: 1101.93 qps: 22045.65 (r/w/o: 15432.05/4409.73/2203.86) lat (ms,95%): 17.01 err/s: 0.00 reconn/s: 0.00
[ 20s ] thds: 16 tps: 759.16 qps: 15124.24 (r/w/o: 10587.27/3019.65/1517.32) lat (ms,95%): 61.08 err/s: 0.00 reconn/s: 0.00
[ 21s ] thds: 16 tps: 1095.75 qps: 21946.00 (r/w/o: 15366.50/4388.00/2191.50) lat (ms,95%): 16.71 err/s: 0.00 reconn/s: 0.00
[ 22s ] thds: 16 tps: 756.07 qps: 15209.36 (r/w/o: 10630.95/3065.27/1513.14) lat (ms,95%): 52.89 err/s: 0.00 reconn/s: 0.00
[ 23s ] thds: 16 tps: 1082.06 qps: 21555.26 (r/w/o: 15097.88/4293.25/2164.13) lat (ms,95%): 19.65 err/s: 0.00 reconn/s: 0.00
[ 24s ] thds: 16 tps: 990.90 qps: 19767.95 (r/w/o: 13841.57/3944.59/1981.79) lat (ms,95%): 30.26 err/s: 0.00 reconn/s: 0.00
[ 25s ] thds: 16 tps: 744.12 qps: 14928.48 (r/w/o: 10450.74/2989.50/1488.25) lat (ms,95%): 54.83 err/s: 0.00 reconn/s: 0.00
[ 26s ] thds: 16 tps: 1037.85 qps: 20736.04 (r/w/o: 14510.93/4150.41/2074.70) lat (ms,95%): 21.89 err/s: 0.00 reconn/s: 0.00
[ 27s ] thds: 16 tps: 667.88 qps: 13342.61 (r/w/o: 9335.33/2670.52/1336.76) lat (ms,95%): 69.29 err/s: 0.00 reconn/s: 0.00
[ 28s ] thds: 16 tps: 1070.99 qps: 21434.72 (r/w/o: 15009.80/4282.94/2141.97) lat (ms,95%): 17.95 err/s: 0.00 reconn/s: 0.00
[ 29s ] thds: 16 tps: 1070.16 qps: 21409.29 (r/w/o: 14990.30/4279.66/2139.33) lat (ms,95%): 17.32 err/s: 0.00 reconn/s: 0.00
[ 30s ] thds: 16 tps: 774.04 qps: 15489.75 (r/w/o: 10836.52/3105.15/1548.07) lat (ms,95%): 62.19 err/s: 0.00 reconn/s: 0.00
[ 31s ] thds: 16 tps: 1107.76 qps: 22127.17 (r/w/o: 15494.62/4418.04/2214.52) lat (ms,95%): 16.71 err/s: 0.00 reconn/s: 0.00
[ 32s ] thds: 16 tps: 777.29 qps: 15545.86 (r/w/o: 10872.10/3117.18/1556.59) lat (ms,95%): 47.47 err/s: 0.00 reconn/s: 0.00
[ 33s ] thds: 16 tps: 1080.79 qps: 21628.88 (r/w/o: 15144.12/4323.18/2161.59) lat (ms,95%): 17.32 err/s: 0.00 reconn/s: 0.00
[ 34s ] thds: 16 tps: 984.89 qps: 19685.82 (r/w/o: 13780.48/3935.57/1969.78) lat (ms,95%): 18.28 err/s: 0.00 reconn/s: 0.00
[ 35s ] thds: 16 tps: 791.22 qps: 15754.48 (r/w/o: 11018.13/3154.90/1581.45) lat (ms,95%): 51.94 err/s: 0.00 reconn/s: 0.00
[ 36s ] thds: 16 tps: 1067.87 qps: 21341.44 (r/w/o: 14931.21/4273.49/2136.74) lat (ms,95%): 19.29 err/s: 0.00 reconn/s: 0.00
[ 37s ] thds: 16 tps: 752.13 qps: 15124.64 (r/w/o: 10607.85/3012.52/1504.26) lat (ms,95%): 52.89 err/s: 0.00 reconn/s: 0.00
[ 38s ] thds: 16 tps: 982.76 qps: 19580.31 (r/w/o: 13690.72/3925.06/1964.53) lat (ms,95%): 32.53 err/s: 0.00 reconn/s: 0.00
[ 39s ] thds: 16 tps: 1110.14 qps: 22319.86 (r/w/o: 15629.00/4469.57/2221.28) lat (ms,95%): 16.41 err/s: 0.00 reconn/s: 0.00
[ 40s ] thds: 16 tps: 680.97 qps: 13617.32 (r/w/o: 9541.52/2713.86/1361.93) lat (ms,95%): 58.92 err/s: 0.00 reconn/s: 0.00
[ 41s ] thds: 16 tps: 1111.87 qps: 22208.31 (r/w/o: 15549.12/4436.46/2222.73) lat (ms,95%): 16.71 err/s: 0.00 reconn/s: 0.00
[ 42s ] thds: 16 tps: 805.03 qps: 16108.54 (r/w/o: 11267.38/3231.11/1610.05) lat (ms,95%): 37.56 err/s: 0.00 reconn/s: 0.00
[ 43s ] thds: 16 tps: 1045.95 qps: 20910.98 (r/w/o: 14639.28/4179.80/2091.90) lat (ms,95%): 17.95 err/s: 0.00 reconn/s: 0.00
[ 44s ] thds: 16 tps: 1094.33 qps: 21819.55 (r/w/o: 15269.58/4364.31/2185.66) lat (ms,95%): 17.01 err/s: 0.00 reconn/s: 0.00
[ 45s ] thds: 16 tps: 783.97 qps: 15710.35 (r/w/o: 10996.55/3141.87/1571.94) lat (ms,95%): 51.02 err/s: 0.00 reconn/s: 0.00
[ 46s ] thds: 16 tps: 1038.84 qps: 20800.89 (r/w/o: 14565.82/4157.38/2077.69) lat (ms,95%): 20.00 err/s: 0.00 reconn/s: 0.00
[ 47s ] thds: 16 tps: 857.18 qps: 17127.60 (r/w/o: 11987.52/3425.72/1714.36) lat (ms,95%): 42.61 err/s: 0.00 reconn/s: 0.00
[ 48s ] thds: 16 tps: 775.87 qps: 15554.33 (r/w/o: 10891.13/3111.47/1551.73) lat (ms,95%): 24.38 err/s: 0.00 reconn/s: 0.00
[ 49s ] thds: 16 tps: 1065.00 qps: 21241.01 (r/w/o: 14862.01/4249.00/2130.00) lat (ms,95%): 18.95 err/s: 0.00 reconn/s: 0.00
[ 50s ] thds: 16 tps: 671.06 qps: 13512.29 (r/w/o: 9480.90/2690.26/1341.13) lat (ms,95%): 63.32 err/s: 0.00 reconn/s: 0.00
[ 51s ] thds: 16 tps: 1084.98 qps: 21700.59 (r/w/o: 15188.71/4340.92/2170.96) lat (ms,95%): 17.01 err/s: 0.00 reconn/s: 0.00
[ 52s ] thds: 16 tps: 884.84 qps: 17622.83 (r/w/o: 12318.78/3536.36/1767.68) lat (ms,95%): 31.94 err/s: 0.00 reconn/s: 0.00
[ 53s ] thds: 16 tps: 979.12 qps: 19590.36 (r/w/o: 13714.65/3916.47/1959.24) lat (ms,95%): 28.67 err/s: 0.00 reconn/s: 0.00
[ 54s ] thds: 16 tps: 1097.01 qps: 21962.12 (r/w/o: 15383.09/4384.02/2195.01) lat (ms,95%): 17.01 err/s: 0.00 reconn/s: 0.00
[ 55s ] thds: 16 tps: 780.05 qps: 15610.91 (r/w/o: 10919.63/3131.18/1560.09) lat (ms,95%): 59.99 err/s: 0.00 reconn/s: 0.00
[ 56s ] thds: 16 tps: 1085.05 qps: 21662.94 (r/w/o: 15161.66/4332.19/2169.09) lat (ms,95%): 17.63 err/s: 0.00 reconn/s: 0.00
[ 57s ] thds: 16 tps: 906.00 qps: 18179.06 (r/w/o: 12727.04/3639.01/1813.01) lat (ms,95%): 30.26 err/s: 0.00 reconn/s: 0.00
[ 58s ] thds: 16 tps: 943.95 qps: 18825.03 (r/w/o: 13173.32/3764.81/1886.90) lat (ms,95%): 25.74 err/s: 0.00 reconn/s: 0.00
[ 59s ] thds: 16 tps: 1110.87 qps: 22218.32 (r/w/o: 15554.12/4441.46/2222.73) lat (ms,95%): 17.01 err/s: 0.00 reconn/s: 0.00
[ 60s ] thds: 16 tps: 796.00 qps: 15868.00 (r/w/o: 11099.00/3177.00/1592.00) lat (ms,95%): 52.89 err/s: 0.00 reconn/s: 0.00--SQL统计信息,SQL的读/写/其他/总计次数、总事务数及每秒事务数、总查询数及每秒查询数、忽略错误数据、重新数据SQL statistics:queries performed:read:                            787738write:                           225068other:                           112534total:                           1125340transactions:                        56267  (937.50 per sec.)queries:                             1125340 (18750.05 per sec.)ignored errors:                      0      (0.00 per sec.)reconnects:                          0      (0.00 per sec.)--通用统计信息:总时间、总操作数General statistics:total time:                          60.0162stotal number of events:              56267--耗时信息(单位毫秒):最小、平均、最大、95%耗时、总耗时Latency (ms):min:                                   10.73avg:                                   17.06max:                                  311.7195th percentile:                       28.67sum:                               960075.64Threads fairness:events (avg/stddev):           3516.6875/178.13execution time (avg/stddev):   60.0047/0.00--清理
# sysbench --threads=16 --time=60 --report-interval=1 oltp_read_write  --mysql-host=66.3.125.125 --mysql-port=3306 --mysql-user=root --mysql-password=root2023 \
--mysql-db=test --tables=4 --table-size=100000 cleanup
sysbench 1.0.20 (using bundled LuaJIT 2.1.0-beta2)Dropping table 'sbtest1'...
Dropping table 'sbtest2'...
Dropping table 'sbtest3'...
Dropping table 'sbtest4'...mysql> use test;
Database changed
mysql> show tables;
Empty set (0.00 sec)

关闭数据库

$ mysqladmin shutdown  -uroot -proot2023
mysqladmin: [Warning] Using a password on the command line interface can be insecure.

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://xiahunao.cn/news/2662307.html

如若内容造成侵权/违法违规/事实不符,请联系瞎胡闹网进行投诉反馈,一经查实,立即删除!

相关文章

SourceTree的安装和使用

提示&#xff1a;文章写完后&#xff0c;目录可以自动生成&#xff0c;如何生成可参考右边的帮助文档 文章目录 前言一、安装&#xff1a;二、使用步骤1.获取地址2.放入sourceTree 3.点击推送 前言 提示&#xff1a;这里可以添加本文要记录的大概内容&#xff1a; 简单讲解一…

Vue - 实现文件导出文件保存下载

1 文件导出&#xff1a;使用XLSX插件 需求背景&#xff1a;纯前端导出&#xff0c;如 在前端页面勾选部分表格数据&#xff0c;点击"导出"按钮导出Excel文件。 实现思路&#xff1a; 1.通过XLSX插件的 XLSX.utils.book_new()方法&#xff0c;创建excel工作蒲对象wb…

既然前端工程师可以进腾讯字节阿里等大厂,为什么要高薪进小公司?

前言 前不久后台有一个粉丝给我留言&#xff1a;为什么很多人参加校招的时候&#xff0c;宁愿低薪也要进大厂&#xff0c;而不选择更高薪的小公司呢&#xff1f; &#xff08;文末有惊喜&#xff01;文末有惊喜&#xff01;&#xff09; 我想了一下&#xff0c;大概是有3个原因…

6130 树的最长路

思路&#xff1a;树的最长路问题可以通过两次 DFS 求解&#xff0c;具体思路如下&#xff1a; 1.第一次 DFS 求树的直径 以任意一个点为起点进行深度优先遍历&#xff08;DFS&#xff09;&#xff0c;找到与该点距离最远的点 u 。 以 u 为起点进行 DFS &#xff0c;找到与 u 距…

win10系统gpu本地部署chatglm3-6b,从0开始安装

开源地址&#xff1a; GitHub - THUDM/ChatGLM3: ChatGLM3 series: Open Bilingual Chat LLMs | 开源双语对话语言模型 前言&#xff1a;ChatGLM2与ChatGLM3区别 ChatGLM2与ChatGLM3模型架构是完全一致的&#xff0c;ChatGLM与后继者结构不同。可见ChatGLM3相对于ChatGLM2没…

LabVIEW在电机噪声与振动探测的应用

LabVIEW在电机噪声与振动探测的应用 硬件部分是电机噪声和振动测试分析系统的基础&#xff0c;主要由三大核心组件构成&#xff1a;高灵敏度振动传感器、先进的信号调理电路和高性能数据采集卡。这些设备协同工作&#xff0c;确保了从电机捕获的噪声和振动信号的准确性和可靠性…

盲盒电商:重塑消费者行为与市场格局

一、什么是盲盒电商&#xff1f; 盲盒电商是一种新型的电子商务模式&#xff0c;它通过将商品隐藏在盲盒中&#xff0c;让消费者在购买时无法知道具体商品&#xff0c;只能通过猜测和期待来体验购物的乐趣。这种模式在年轻人中非常受欢迎&#xff0c;因为它提供了一种全新的购…

labuladong日常刷题-递归魔法 | LeetCode 206反转链表 92反转链表-ii

递归魔法 LeetCode 206 反转链表 2023.12.26 题目链接labuladong讲解[链接] ListNode* reverseList(ListNode* head) {//递归退出条件if(head NULL || head->next NULL)return head;//递归ListNode* last reverseList(head->next);//处理head->next->next …

电脑msvcr120.dll丢失怎样修复,一分钟教会你修复方法

在计算机使用过程中&#xff0c;我们可能会遇到各种问题&#xff0c;其中之一就是“msvcr120.dll丢失”的错误提示。这个错误通常发生在运行某些程序时&#xff0c;由于系统缺少了msvcr120.dll文件&#xff0c;导致程序无法正常运行。那么&#xff0c;什么是msvcr120.dll文件呢…

深入浅出理解转置卷积Conv2DTranspose

温故而知新&#xff0c;可以为师矣&#xff01; 一、参考资料 论文&#xff1a;A guide to convolution arithmetic for deep learning github源码&#xff1a;Convolution arithmetic bilibili视频&#xff1a;转置卷积&#xff08;transposed convolution&#xff09; 转置…

【C++】引用详解

前言 在学习C语言时&#xff0c;我们通常会遇到两个数交换的问题&#xff0c;为了实现这一功能&#xff0c;我们会编写一个经典的Swap函数&#xff0c;如下所示&#xff1a; void Swap(int *a, int *b) {int tmp *a;*a *b;*b tmp; } 然而&#xff0c;这个Swap函数看起来可…

智能监控平台/视频共享融合系统EasyCVR点击通道后页面分页不显示是什么原因?如何解决?

TSINGSEE青犀视频监控汇聚平台EasyCVR可拓展性强、视频能力灵活、部署轻快&#xff0c;可支持的主流标准协议有国标GB28181、RTSP/Onvif、RTMP等&#xff0c;以及支持厂家私有协议与SDK接入&#xff0c;包括海康Ehome、海大宇等设备的SDK等。平台既具备传统安防视频监控的能力&…

leetcode 75. 颜色分类(medium)(优质解法)

链接&#xff1a;力扣&#xff08;LeetCode&#xff09;官网 - 全球极客挚爱的技术成长平台 代码&#xff1a; class Solution {public void sortColors(int[] nums) {int left-1,rightnums.length,i0;while(i<right){if(nums[i]0){left;swap(nums,left,i);i;}else if(nums…

LLaVA-v1.5-7B:实现先进多模态学习的开源AI

引言 LLaVA-v1.5-7B是一个开源大型多模态模型&#xff08;LMM&#xff09;&#xff0c;它通过结合视觉指令调整&#xff08;Visual Instruction Tuning&#xff09;技术&#xff0c;展示了在多模态理解和生成任务上的卓越性能。该模型特别注重简洁性和数据效率&#xff0c;利用…

一篇文章深入认识微服务SpringCloud和Dubbo的区别

1、SpringCloud是什么 SpringCloud, 基于SpringBoot提供了一套微服务解决方案&#xff0c;包括服务注册与发现&#xff0c;配置中心&#xff0c;全链路监控&#xff0c;服务网关&#xff0c;负载均衡&#xff0c;熔断器等组件&#xff0c;除了基于NetFlix的开源组件做高度抽象…

18B20受到LED灯的干扰处理方法

鱼缸使用了18B20测温&#xff0c;采用PWM控制加热棒加热占空比的方法控制鱼缸温度&#xff0c;使用了最简单的温度差调整PWM宽度的方法&#xff0c;温度差越大PWM占空比越大&#xff0c;从而产生更多的加热时间&#xff0c;当温度接近设定值的时候&#xff0c;PWM逐步缩小&…

limit查询报错问题

分页时候 limit 后面的公式是 (pageNum-1)*pageSize,pageSize 但是在数据库查询时候 当然在.XML中也不能像下面这么写,如果要计算 在业务层或者控制层计算好再传值进来

晋级名单揭晓!一览 2023 冬季波卡黑客松决赛项目

在 2023 冬季波卡黑客松大赛的舞台上&#xff0c;有这样一群怀揣梦想的选手为了开发极具市场潜力的新星项目奋战了无数个日日夜夜。他们集结于此&#xff0c;只为从 0 到 1 开拓出 Web3 创业的发展新路。 走过 7 届赛事征程&#xff0c;波卡黑客松大赛一如既往地作为创业项目“…

Prometheus快速入门实战

介绍 prometheus 受启发于 Google 的 Brogmon 监控系统&#xff08;相似 kubernetes 是从 Brog 系统演变而来&#xff09;。2016 年 5 月继 kubernetes 之后成为第二个加入 CNCF 基金会的项目&#xff0c;同年 6 月正式发布 1.0 版本。2017 年底发布基于全新存储层的 2.0 版本…

【DDPM】扩散模型DDPM的原理介绍(2)

本篇博客是上一篇博客的续。在上一篇博客中介绍了扩散模型DDPM的扩散过程和反向过程&#xff0c;本篇博客主要介绍DDPM的优化目标、模型结构以及与其它深度生成模型的比较。废话不多说&#xff0c;那就开始吧~ 优化目标 模型的结构 与其它深度生成模型的比较 图片生成领域最常见…