当前位置: 首页 > news >正文

网站加手机建设png图标搭建小程序需要什么技术

网站加手机建设png图标,搭建小程序需要什么技术,嘉兴网站建设方案策划,查公司的网站有哪些目录 配置项目环境: 参考:采用sysbench压测mysql详解_dream21st的博客-CSDN博客 实验步骤: 1、安装sysbench工具 2、在master上创建用户和库,配置用户的权限可以使他可以访问库(Mysql的主从复制) 3、基…

目录

配置项目环境:

参考:采用sysbench压测mysql详解_dream21st的博客-CSDN博客

实验步骤:

1、安装sysbench工具

2、在master上创建用户和库,配置用户的权限可以使他可以访问库(Mysql的主从复制)

3、基于sysbench构造测试表和测试数据

4、创建我们需要的数据库里的数据

5、数据库读写性能测试(获取测试数据)

6、执行完成压测之后可以将run改成cleanup,清除数据

sysbench工具对Mysql数据库的其他测试代码:

数据库读性能测试:

数据库删除性能测试:

数据库更新索引字段性能测:

数据库更新非索引字段性能测试:

数据库插入数据性能测试:

数据库写性能测试:

数据库清除创建的测试数据:


配置项目环境:

[root@ab ~]# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)[root@mysql-1 ~]# mysql --version
mysql  Ver 14.14 Distrib 5.7.41, for linux-glibc2.12 (x86_64) using  EditLine wrapper
[root@mysql-1 ~]# 

参考:采用sysbench压测mysql详解_dream21st的博客-CSDN博客

实验步骤:

1、安装sysbench工具

[root@ab ~]# yum install epel-release -y[root@ab ~]# yum install sysbench -y已安装:sysbench.x86_64 0:1.0.17-2.el7                                                                                                                                                             作为依赖被安装:ck.x86_64 0:0.5.2-2.el7                           luajit.x86_64 0:2.0.5-1.20220913.46e62cd.el7                           postgresql-libs.x86_64 0:9.2.24-8.el7_9                          完毕!

2、在master上创建用户和库,配置用户的权限可以使他可以访问库(Mysql的主从复制)

参考:Mysql - 配置Mysql主从复制-keepalived高可用-读写分离集群_Claylpf的博客-CSDN博客

CREATE USER 'claylpf'@'%' IDENTIFIED BY '123456';  #创建用户create database test_db;  #创建测试库GRANT ALL PRIVILEGES ON test_db.* TO 'claylpf'@'%';  #配置用户权限FLUSH PRIVILEGES;  #重新加载用户权限表

3、基于sysbench构造测试表和测试数据

[root@ab ~]# sysbench --db-driver=mysql --time=300 --threads=10 --report-interval=1 --mysql-host=192.168.2.221 --mysql-port=7001 --mysql-user=claylpf --mysql-password=123456 --mysql-db=test_db --tables=10 --table_size=1000 oltp_read_write --db-ps-mode=disable prepare

命令行中的参数说明:

​--db-driver=mysql:代表数据库驱动

--time=300:这个就是说连续访问300秒

--threads=10:这个就是说用10个线程模拟并发访问

--report-interval=1:这个就是说每隔1秒输出一下压测情况

--mysql-host=192.168.2.221 --mysql-port=7001 --mysql-user=claylpf --mysql-password=123456:数据库的用户和密码等信息

--mysql-db=test_db --tables=20 --table_size=1000000:这一串的意思,就是说在test_db这个库里,构造20个测试表,每个测试表里构造100万条测试数据,测试表的名字会是类似于sbtest1,sbtest2这个样子的

​oltp_read_write:这个就是说,执行oltp数据库的读写测试

--db-ps-mode=disable:这个就是禁止ps模式

prepare:意思是参照这个命令的设置去构造出来我们需要的数据库里的数据,他会自动创建20个测试表,每个表里创建100万条测试数据,所以这个工具是非常的方便的。

4、创建我们需要的数据库里的数据

[root@ab ~]# sysbench --db-driver=mysql --time=300 --threads=10 --report-interval=1 --mysql-host=192.168.2.221 --mysql-port=7001 --mysql-user=claylpf --mysql-password=123456 --mysql-db=test_db --tables=10 --table_size=1000 oltp_read_write --db-ps-mode=disable prepare# 注意--tables=10 --table_size=1000所对应的数据不能调试太大(如:--tables=20 --table_size=1000000000),否则会导致你的Mysql集群的磁盘耗尽,导致集群崩溃.
sysbench 1.0.17 (using system LuaJIT 2.0.4)Initializing worker threads...Creating table 'sbtest10'...
Creating table 'sbtest3'...
Creating table 'sbtest9'...
Creating table 'sbtest6'...
Creating table 'sbtest1'...
Creating table 'sbtest8'...
Creating table 'sbtest4'...
Creating table 'sbtest5'...
Creating table 'sbtest7'...
Creating table 'sbtest2'...
Inserting 1000 records into 'sbtest10'
Inserting 1000 records into 'sbtest1'
Inserting 1000 records into 'sbtest2'
Inserting 1000 records into 'sbtest4'
Inserting 1000 records into 'sbtest5'
Inserting 1000 records into 'sbtest6'
Inserting 1000 records into 'sbtest7'
Inserting 1000 records into 'sbtest8'
Inserting 1000 records into 'sbtest9'
Inserting 1000 records into 'sbtest3'
Creating a secondary index on 'sbtest1'...
Creating a secondary index on 'sbtest10'...
Creating a secondary index on 'sbtest6'...
Creating a secondary index on 'sbtest4'...
Creating a secondary index on 'sbtest5'...
Creating a secondary index on 'sbtest2'...
Creating a secondary index on 'sbtest7'...
Creating a secondary index on 'sbtest9'...
Creating a secondary index on 'sbtest8'...
Creating a secondary index on 'sbtest3'...

5、数据库读写性能测试(获取测试数据)

数据库读写性能测试,将执行指令最后的prepare修改成run:

[root@ab ~]# sysbench --db-driver=mysql --time=300 --threads=10 --report-interval=1 --mysql-host=192.168.2.221 --mysql-port=7001 --mysql-user=claylpf --mysql-password=123456 --mysql-db=test_db --tables=10 --table_size=1000 oltp_read_write --db-ps-mode=disable run
sysbench 1.0.17 (using system LuaJIT 2.0.4)Running the test with following options:
Number of threads: 10
Report intermediate results every 1 second(s)
Initializing random number generator from current timeInitializing worker threads...Threads started!
#​ 下面是截取的执行1秒,2秒,3秒,4秒等的数据。
[ 1s ] thds: 10 tps: 172.58 qps: 3597.26 (r/w/o: 2541.82/701.30/354.14) lat (ms,95%): 71.83 err/s: 0.00 reconn/s: 0.00
[ 2s ] thds: 10 tps: 187.08 qps: 3691.57 (r/w/o: 2574.10/745.32/372.16) lat (ms,95%): 71.83 err/s: 0.00 reconn/s: 0.00
[ 3s ] thds: 10 tps: 196.01 qps: 3961.13 (r/w/o: 2774.09/792.03/395.01) lat (ms,95%): 65.65 err/s: 0.00 reconn/s: 0.00
[ 4s ] thds: 10 tps: 206.93 qps: 4139.62 (r/w/o: 2900.04/824.73/414.86) lat (ms,95%): 64.47 err/s: 1.00 reconn/s: 0.00
[ 5s ] thds: 10 tps: 212.06 qps: 4236.12 (r/w/o: 2970.79/841.22/424.11) lat (ms,95%): 62.19 err/s: 0.00 reconn/s: 0.00
[ 6s ] thds: 10 tps: 184.06 qps: 3728.31 (r/w/o: 2608.92/751.26/368.13) lat (ms,95%): 97.55 err/s: 0.00 reconn/s: 0.00
[ 7s ] thds: 10 tps: 208.86 qps: 4131.17 (r/w/o: 2894.02/819.44/417.71) lat (ms,95%): 59.99 err/s: 0.00 reconn/s: 0.00
[ 8s ] thds: 10 tps: 214.14 qps: 4283.87 (r/w/o: 2997.01/858.58/428.29) lat (ms,95%): 62.19 err/s: 0.00 reconn/s: 0.00
[ 9s ] thds: 10 tps: 187.96 qps: 3725.23 (r/w/o: 2600.47/750.85/373.92) lat (ms,95%): 84.47 err/s: 0.00 reconn/s: 0.00
[ 10s ] thds: 10 tps: 195.96 qps: 3981.11 (r/w/o: 2795.38/791.82/393.91) lat (ms,95%): 66.84 err/s: 0.00 reconn/s: 0.00
^C
[root@ab ~]# 

对表中的数据进行说明,以第一条数据做解释描述:

thds: 10:这个意思就是有10个线程在压测

​ tps: 151.70:这个意思就是每秒执行了151.70个事务

​ qps: 2996.03:这个意思就是每秒可以执行2996.03个请求

​ (r/w/o: 2091.83/600.80/303.40):这个意思就是说,在每秒2996.03个请求中,有2091.83个请求是读请求,600.80个请求是写请求,303.40个请求是其他的请求,就是对QPS进行了拆解

​ lat (ms, 95%): 97.55:这个意思就是说,95%的请求的延迟都在 97.55毫秒以下

​ err/s: 0.00 reconn/s: 0.00:这两个的意思就是说,每秒有0个请求是失败的,发生了0次网络重连

下面是执行完成后控制台输出的数据:

SQL statistics:queries performed:read:                            836822write:                           239020other:                           119517total:                           1195359transactions:                        59744  (199.12 per sec.)queries:                             1195359 (3984.01 per sec.)ignored errors:                      29     (0.10 per sec.)reconnects:                          0      (0.00 per sec.)General statistics:total time:                          300.0377stotal number of events:              59744Latency (ms):min:                                   19.82avg:                                   50.21max:                                  267.2895th percentile:                       68.05sum:                              2999907.14Threads fairness:events (avg/stddev):           5974.4000/21.35execution time (avg/stddev):   299.9907/0.01

6、执行完成压测之后可以将run改成cleanup,清除数据

[root@ab ~]# sysbench --db-driver=mysql --time=300 --threads=10 --report-interval=1 --mysql-host=192.168.2.221 --mysql-port=7001 --mysql-user=claylpf --mysql-password=123456 --mysql-db=test_db --tables=10 --table_size=1000 oltp_read_write --db-ps-mode=disable cleanup
sysbench 1.0.17 (using system LuaJIT 2.0.4)Dropping table 'sbtest1'...
Dropping table 'sbtest2'...
Dropping table 'sbtest3'...
Dropping table 'sbtest4'...
Dropping table 'sbtest5'...
Dropping table 'sbtest6'...
Dropping table 'sbtest7'...
Dropping table 'sbtest8'...
Dropping table 'sbtest9'...
Dropping table 'sbtest10'...
[root@ab ~]# 

sysbench工具对Mysql数据库的其他测试代码:

数据库读性能测试:

sysbench --db-driver=mysql --time=300 --threads=10 --report-interval=1 --mysql-host=192.168.2.221 --mysql-port=7001 --mysql-user=claylpf --mysql-password=123456 --mysql-db=test_db --tables=10 --table_size=1000 oltp_read_only --db-ps-mode=disable run

数据库删除性能测试:

sysbench --db-driver=mysql --time=300 --threads=10 --report-interval=1 --mysql-host=192.168.2.221 --mysql-port=7001 --mysql-user=claylpf --mysql-password=123456 --mysql-db=test_db --tables=10 --table_size=1000 oltp_delete --db-ps-mode=disable run

数据库更新索引字段性能测:

sysbench --db-driver=mysql --time=300 --threads=10 --report-interval=1 --mysql-host=192.168.2.221 --mysql-port=7001 --mysql-user=claylpf --mysql-password=123456 --mysql-db=test_db --tables=10 --table_size=1000 oltp_update_index --db-ps-mode=disable run

数据库更新非索引字段性能测试:

sysbench --db-driver=mysql --time=300 --threads=10 --report-interval=1 --mysql-host=192.168.2.221 --mysql-port=7001 --mysql-user=claylpf --mysql-password=123456 --mysql-db=test_db --tables=10 --table_size=1000 oltp_update_non_index --db-ps-mode=disable run

数据库插入数据性能测试:

sysbench --db-driver=mysql --time=300 --threads=10 --report-interval=1 --mysql-host=192.168.2.221 --mysql-port=7001 --mysql-user=claylpf --mysql-password=123456 --mysql-db=test_db --tables=10 --table_size=1000 oltp_insert --db-ps-mode=disable run

数据库写性能测试:

sysbench --db-driver=mysql --time=300 --threads=10 --report-interval=1 --mysql-host=192.168.2.221 --mysql-port=7001 --mysql-user=claylpf --mysql-password=123456 --mysql-db=test_db --tables=10 --table_size=1000 oltp_write_only --db-ps-mode=disable run

数据库清除创建的测试数据:

sysbench --db-driver=mysql --time=300 --threads=10 --report-interval=1 --mysql-host=192.168.2.221 --mysql-port=7001 --mysql-user=claylpf --mysql-password=123456 --mysql-db=test_db --tables=10 --table_size=1000 oltp_read_write --db-ps-mode=disable cleanup
http://www.yayakq.cn/news/37526/

相关文章:

  • 自助建站系统注册为什么做网站必须用服务器
  • h5游戏网站建设工业设计公司怎么赚钱
  • 制作企业网站要花多少钱代码编程入门教学视频
  • 装修行业网站建设中国最大的网络公司是哪个
  • 网站关键词排名批量查询萨龙wordpress
  • 做一个网站需要什么条件邢台吧 百度贴吧
  • 南京做网站群的公司株洲在线论坛伴你生活每一天
  • 网站被百度收录网站建设最新外文翻译
  • 移动互联时代网站建设广州口碑好的网站建设设计
  • 广州做网站app江西住房和城乡建设信息网站
  • 最超值的郑州网站建设建网站有什么要注意的
  • 北京网站建设中企云达vi设计的目的和意义
  • 做文学网站需要网站后台怎么用
  • 网站建设文翻译工作室女生做网站推广
  • 学校网站英文竞网网站建设
  • 好看的网站颜色搭配谷德设计网作品集
  • 礼物说网站模板深圳网站制作建设服务公司
  • dede学校网站潍坊做网页的公司
  • 平湖网站制作南京 网站制作公司
  • 怎么建网站做seo提升排名
  • 建立网站很重要的要素是什么招聘网站的建设
  • wap网站建设用什么工具专业的seo搜索引擎优化培训
  • 各省住房和城乡建设厅网站知名的集团门户网站建设企业
  • 建设网站终身免费网站推广和优化的原因网络营销
  • 网络营销推广网站收录哪些网站描述样本
  • 前端做图表的网站中小企业库
  • 青海住房与建设厅网站石家庄热点头条新闻
  • 企业网站建设备案需要哪些资料seo整站优化哪家好
  • 番禺建设网站公司wordpress 微信 支付宝
  • 轮网站开发的重要性wordpress打开速度很慢