做网站也是一门技术外贸网站英文版

web/2025/9/26 23:00:59/文章来源:
做网站也是一门技术,外贸网站英文版,三亚久爱传媒招聘信息,eclipse网站开发教程一、MySQL自带的压力测试工具——Mysqlslapmysqlslap是mysql自带的基准测试工具,该工具查询数据,语法简单,灵活容易使用.该工具可以模拟多个客户端同时并发的向服务器发出查询更新,给出了性能测试数据而且提供了多种引擎的性能比较。mysqlslap为mysql性能优化前后提供了直观的验…一、MySQL自带的压力测试工具——Mysqlslapmysqlslap是mysql自带的基准测试工具,该工具查询数据,语法简单,灵活容易使用.该工具可以模拟多个客户端同时并发的向服务器发出查询更新,给出了性能测试数据而且提供了多种引擎的性能比较。mysqlslap为mysql性能优化前后提供了直观的验证依据,系统运维和DBA人员应该掌握一些常见的压力测试工具,才能准确的掌握线上数据库支撑的用户流量上限及其抗压性等问题。1、更改其默认的最大连接数在对MySQL进行压力测试之前需要更改其默认的最大连接数如下[rootmysql data]# vim /etc/my.cnf #编辑主配置文件[mysqld]............#省略部分内容max_connections1024如下mysql show variables like max_connections; #查看最大连接数------------------------| Variable_name | Value |------------------------| max_connections | 1024 |------------------------1 row in set (0.00 sec)进行压力测试[rootmysql ~]# mysqlslap --defaults-file/etc/my.cnf --concurrency100,200 --iterations1 --number-int-cols20 --number-char-cols30 --auto-generate-sql --auto-generate-sql-add-autoincrement --auto-generate-sql-load-typemixed --enginemyisam,innodb --number-of-queries2000 -uroot -p123.com --verbose上述命令测试说明模拟测试两次读写并发第一次100第二次200自动生成SQL脚本测试表包含20个init字段30个char字段每次执行2000查询请求。测试引擎分别是myisaminnodb。(上述选项中有很多都是默认值可以省略如果想要了解各个选项的解释可以使用mysqlslap --help进行查询)上述命令返回结果如下测试结果说明 Myisam第一次100客户端同时发起增查用0.557/s,第二次200客户端同时发起增查用0.522/s Innodb第一次100客户端同时发起增查用0.256/s,第二次200客户端同时发起增查用0.303/s 。可以根据实际需求一点点的加大并发数量进行压力测试。二、使用第三方sysbench工具进行压力测试1、安装sysbench工具[rootmysql ~]# yum -y install epel-release #安装第三方epel源[rootmysql ~]# yum -y install sysbench #安装sysbench工具[rootmysql ~]# sysbench --version #确定工具已安装sysbench 1.0.17sysbench 可以进行以下测试CPU 运算性能测试磁盘 IO 性能测试调度程序性能测试内存分配及传输速度测试POSIX 线程性能测试数据库性能测试(OLTP 基准测试需要通过 /usr/share/sysbench/ 目录中的 Lua 脚本执行例如 oltp_read_only.lua 脚本执行只读测试)sysbench 还可以通过运行命令时指定自己的 Lua 脚本来自定义测试。2、查看sysbench工具的帮助选项[rootmysql ~]# sysbench --helpUsage:sysbench [options]... [testname] [command]Commands implemented by most tests: prepare run cleanup help # 可用的命令四个General options: # 通用选项--threadsN 要使用的线程数默认 1 个 [1]--eventsN 最大允许的事件个数 [0]--timeN 最大的总执行时间以秒为单位 [10]--forced-shutdownSTRING 在 --time 时间限制到达后强制关闭之前等待的秒数默认“off”禁用(number of seconds to wait after the --time limit before forcing shutdown, or off to disable) [off]--thread-stack-sizeSIZE 每个线程的堆栈大小 [64K]--rateN 平均传输速率。0 则无限制 [0]--report-intervalN 以秒为单位定期报告具有指定间隔的中间统计信息 0 禁用中间报告 [0]--report-checkpoints[LIST,...] 转储完整的统计信息并在指定的时间点重置所有计数器。参数是一个逗号分隔的值列表表示从测试开始经过这个时间量时必须执行报告检查点(以秒为单位)。报告检查点默认关闭。 []--debug[on|off] 打印更多 debug 信息 [off]--validate[on|off] 尽可能执行验证检查 [off]--help[on|off] 显示帮助信息并退出 [off]--version[on|off] 显示版本信息并退出 [off]--config-fileFILENAME 包含命令行选项的文件--tx-rateN 废弃改用 --rate [0]--max-requestsN 废弃改用 --events [0]--max-timeN 废弃改用 --time [0]--num-threadsN 废弃改用 --threads [1]Pseudo-Random Numbers Generator options: # 伪随机数发生器选项--rand-typeSTRING random numbers distribution {uniform,gaussian,special,pareto} [special]--rand-spec-iterN number of iterations used for numbers generation [12]--rand-spec-pctN percentage of values to be treated as special (for special distribution) [1]--rand-spec-resN percentage of special values to use (for special distribution) [75]--rand-seedN seed for random number generator. When 0, the current time is used as a RNG seed. [0]--rand-pareto-hN parameter h for pareto distribution [0.2]Log options: # 日志选项--verbosityN verbosity level {5 - debug, 0 - only critical messages} [3]--percentileN percentile to calculate in latency statistics (1-100). Use the special value of 0 to disable percentile calculations [95]--histogram[on|off] print latency histogram in report [off]General database options: # 通用的数据库选项--db-driverSTRING 指定要使用的数据库驱动程序 (help to get list of available drivers)--db-ps-modeSTRING prepared statements usage mode {auto, disable} [auto]--db-debug[on|off] print database-specific debug information [off]Compiled-in database drivers: # 內建的数据库驱动程序默认支持 MySQL 和 PostgreSQLmysql - MySQL driverpgsql - PostgreSQL drivermysql options: # MySQL 数据库专用选项--mysql-host[LIST,...] MySQL server host [localhost]--mysql-port[LIST,...] MySQL server port [3306]--mysql-socket[LIST,...] MySQL socket--mysql-userSTRING MySQL user [sbtest]--mysql-passwordSTRING MySQL password []--mysql-dbSTRING MySQL database name [sbtest]--mysql-ssl[on|off] use SSL connections, if available in the client library [off]--mysql-ssl-cipherSTRING use specific cipher for SSL connections []--mysql-compression[on|off] use compression, if available in the client library [off]--mysql-debug[on|off] trace all client library calls [off]--mysql-ignore-errors[LIST,...] list of errors to ignore, or all [1213,1020,1205]--mysql-dry-run[on|off] Dry run, pretend that all MySQL client API calls are successful without executing them [off]pgsql options: # PostgreSQL 数据库专用选项--pgsql-hostSTRING PostgreSQL server host [localhost]--pgsql-portN PostgreSQL server port [5432]--pgsql-userSTRING PostgreSQL user [sbtest]--pgsql-passwordSTRING PostgreSQL password []--pgsql-dbSTRING PostgreSQL database name [sbtest]Compiled-in tests: # 內建测试类型fileio - File I/O testcpu - CPU performance testmemory - Memory functions speed testthreads - Threads subsystem performance testmutex - Mutex performance testSee sysbench help for a list of options for each test.3、sysbench测试MySQL数据库性能1)准备测试数据#查看sysbench自带的lua脚本使用方法[rootmysql ~]# sysbench /usr/share/sysbench/oltp_common.lua help#必须创建sbtest库sbtest事sysbench默认使用的库名[rootmysql ~]# mysqladmin -uroot -p123.com create sbtest;#然后准备测试所用的表这些测试表放在测试库sbtest中。这里使用的lua脚本为/usr/share/sysbench/oltp_common.lua。[rootmysql ~]# sysbench --mysql-host127.0.0.1 \ --mysql-port3306 \ --mysql-userroot \ --mysql-password123.com \ /usr/share/sysbench/oltp_common.lua \ --tables10 \ --table_size100000 \ prepare#其中--tables10表示创建10个测试表#--table_size100000表示每个表中插入10W行数据#prepare表示这是准备数的过程。2)确认测试数据以存在[rootmysql ~]# mysql -uroot -p123.com sbtest; #登录到sbtest库mysql show tables; #查看相应的表------------------| Tables_in_sbtest |------------------| sbtest1 || sbtest10 || sbtest2 || sbtest3 || sbtest4 || sbtest5 || sbtest6 || sbtest7 || sbtest8 || sbtest9 |------------------10 rows in set (0.00 sec)mysql select count(*) from sbtest1; #随机选择一个表确认其有100000条数据----------| count(*) |----------| 100000 |----------1 row in set (0.01 sec)3)数据库测试和结果分析稍微修改下之前准备数据的语句就可以拿来测试了。需要注意的是之前使用的lua脚本为oltp_common.lua它是一个通用脚本是被其它lua脚本调用的它不能直接拿来测试。所以我这里用oltp_read_write.lua脚本来做读、写测试。还有很多其它类型的测试比如只读测试、只写测试、删除测试、大批量插入测试等等。可找到对应的lua脚本进行调用即可。#执行测试命令如下[rootmysql ~]# sysbench --threads4 \ --time20 \ --report-interval5 \ --mysql-host127.0.0.1 \ --mysql-port3306 \ --mysql-userroot \ --mysql-password123.com \ /usr/share/sysbench/oltp_read_write.lua \ --tables10 \ --table_size100000 \ run上述命令返回的结果如下[rootmysql ~]# sysbench --threads4 --time20 --report-interval5 --mysql-host127.0.0.1 --mysql-port3306 --mysql-userroot --mysql-password123.com /usr/share/sysbench/oltp_read_write.lua --tables10 --table_size100000 runsysbench 1.0.17 (using system LuaJIT 2.0.4)Running the test with following options:Number of threads: 4Report intermediate results every 5 second(s)Initializing random number generator from current timeInitializing worker threads...Threads started!#以下是每5秒返回一次的结果统计的指标包括# 线程数、tps(每秒事务数)、qps(每秒查询数)、# 每秒的读/写/其它次数、延迟、每秒错误数、每秒重连次数[ 5s ] thds: 4 tps: 675.29 qps: 13513.94 (r/w/o: 9460.62/2701.95/1351.37) lat (ms,95%): 8.58 err/s: 0.00 reconn/s: 0.00[ 10s ] thds: 4 tps: 679.05 qps: 13586.79 (r/w/o: 9511.29/2717.40/1358.10) lat (ms,95%): 8.58 err/s: 0.00 reconn/s: 0.00[ 15s ] thds: 4 tps: 676.82 qps: 13538.23 (r/w/o: 9476.70/2707.69/1353.84) lat (ms,95%): 8.74 err/s: 0.20 reconn/s: 0.00[ 20s ] thds: 4 tps: 684.62 qps: 13692.11 (r/w/o: 9585.02/2737.86/1369.23) lat (ms,95%): 8.43 err/s: 0.00 reconn/s: 0.00SQL statistics:queries performed:read: 190190 # 执行的读操作数量write: 54337 # 执行的写操作数量other: 27169 # 执行的其它操作数量total: 271696transactions: 13584 (678.88 per sec.) # 执行事务的平均速率queries: 271696 (13578.35 per sec.) # 平均每秒能执行多少次查询ignored errors: 1 (0.05 per sec.)reconnects: 0 (0.00 per sec.)General statistics:total time: 20.0084s # 总消耗时间total number of events: 13584 # 总请求数量(读、写、其它)Latency (ms):min: 2.68avg: 5.89max: 38.2195th percentile: 8.58 # 采样计算的平均延迟sum: 79985.65Threads fairness:events (avg/stddev): 3396.0000/60.84execution time (avg/stddev): 19.9964/0.004、cpu/io/内存等测试sysbench内置的几个测试指标如下[rootmysql ~]# sysbench --help.......... # 省略部分内容Compiled-in tests:fileio - File I/O testcpu - CPU performance testmemory - Memory functions speed testthreads - Threads subsystem performance testmutex - Mutex performance test可以直接help输出测试方法例如fileio测试[rootmysql ~]# sysbench fileio helpsysbench 1.0.17 (using system LuaJIT 2.0.4)fileio options:--file-numN number of files to create [128]--file-block-sizeN block size to use in all IO operations [16384]--file-total-sizeSIZE total size of files to create [2G]--file-test-modeSTRING test mode {seqwr, seqrewr, seqrd, rndrd, rndwr, rndrw}--file-io-modeSTRING file operations mode {sync,async,mmap} [sync]--file-async-backlogN number of asynchronous operatons to queue per thread [128]--file-extra-flags[LIST,...] list of additional flags to use to open files {sync,dsync,direct} []--file-fsync-freqN do fsync() after this number of requests (0 - dont use fsync()) [100]--file-fsync-all[on|off] do fsync() after each write operation [off]--file-fsync-end[on|off] do fsync() at the end of test [on]--file-fsync-modeSTRING which method to use for synchronization {fsync, fdatasync} [fsync]--file-merged-requestsN merge at most this number of IO requests if possible (0 - dont merge) [0]--file-rw-ratioN reads/writes ratio for combined test [1.5]1)测试io性能例如创建5个文件总共2G每个文件大概400M。[rootmysql ~]# sysbench fileio --file-num5 --file-total-size2G prepare[rootmysql ~]# ll -lh test*-rw------- 1 root root 410M 1月 2 18:47 test_file.0-rw------- 1 root root 410M 1月 2 18:47 test_file.1-rw------- 1 root root 410M 1月 2 18:48 test_file.2-rw------- 1 root root 410M 1月 2 18:48 test_file.3-rw------- 1 root root 410M 1月 2 18:48 test_file.4然后运行测试[rootmysql ~]# sysbench --events5000 \ --threads16 \ fileio \ --file-num5 \ --file-total-size2G \ --file-test-moderndrw \ --file-fsync-freq0 \ --file-block-size16384 \ run返回的结果如下Initializing worker threads...Threads started!File operations:reads/s: 6374.88writes/s: 4271.21fsyncs/s: 170.34Throughput: #吞吐量read, MiB/s: 99.61 #表示读带宽written, MiB/s: 66.74 #表示写的带宽General statistics:total time: 0.4684stotal number of events: 5000Latency (ms):min: 0.00avg: 0.99max: 50.6495th percentile: 4.74sum: 4940.23Threads fairness:events (avg/stddev): 312.5000/15.32execution time (avg/stddev): 0.3088/0.012)测试cpu性能[rootmysql ~]# sysbench cpu --threads40 --events10000 --cpu-max-prime20000 run———————— 本文至此结束感谢阅读 ————————

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

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

带搜索网站建设视频教程木纹背景的精致wordpress企业主题

美国总统奥巴马不仅呼吁所有人都学习编程,甚至以身作则编写代码,成为美国历史上首位编写计算机代码的总统。2014 年底,为庆祝“计算机科学教育周”正式启动,奥巴马编写了很简单的计算机代码:在屏幕上画一个正方形。现在…

网站建设与管理基础公司建设网站的申请信用卡

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼(165)Internet的邮件传输协议标准为_______。A)SNMP B)SMTP C)FTP D)TELNET答 案:B知识点:浏览器、电了邮件及Web服务器的安全特性评 析:SNMP即简单网络管理协议;SMTP即简单邮件传输协…

做网站设计需求wordpress外贸数码

github打不开的几种解决方案 参考文章 GitHub 加速镜像 以下是两个免费的 GitHub 公益加速项目 kkgithub.com仅需在 github.com 的 g 前加上 kk,就可正常访问 GitHub。 例如: https://github.com/tldraw/tldraw 将链接更换后: https://…

招商网站建设解决方案建设一个手机网站需要多少钱

正则表达式的作用是匹配文本,将一个模式(正则表达式)与一个文本串进行比较,mysql允许你指定正则表达式,过滤select检索出的数据。但是mysql仅仅支持正则表达式的一个子集。 1、基本字符匹配: select prod_n…

网站备案信息可以改吗用wordpress做论坛

异常就是代表程序出现的问题 父类:Exception 编译时异常:没有继承RuntimeException的异常,直接继承于Exception。编译阶段就会错误提示。 运行时异常:RuntimeException本身和子类。编译阶段没有错误提示,运行时出现…

东莞大岭山做网站公司如何建设考研网站

这种在Halcon中直接导出的代码不能直接放程序中,应该在控件中比如一个按钮中,就不会出错了。

泰安网站建设制作服务visual studio怎么做网页

在安防监控工程中,需要应用到很多的视频光端机,但是我们在使用视频光端机的过程中,往往不可避免的会出现一些故障问题,那针对这些故障问题我们该如何检测以及处理呢?今天,飞畅科技的小编为大家专门整理了几…

网站设计公司哪家专业云南app软件开发

1.H264码流中重要的组成部分,保存针对整个视频序列的参数,丢失SPS的码流通常无法正常解码。 2.SPS信息的保存位置: 封装格式: FLV======会保存在 Tag中的Video Tag Data 部分,会有AVC VIDEO PACKET结构。SPS就包含在其中。 MP4===== H264裸码流: 保存…

做移门图的 网站有哪些机械设备行业网站建设

96 dpiwidth576 height114转载于:https://blog.51cto.com/lch54734/2298115

免费网站建设福州移动电子商务网站建设研究

WPF里面虽然很多形式上跟Winform一样,但是控件的使用上面还是会有很多诧异。RichTextBox就是一个例子,是的,在WPF里面对这个控件可以做很多Winform很难做的效果出来。比如在对RichTextBox插入图片,winform时代除了用复制粘贴这种借…

陕西省建设厅特种工报名网站可以做伦铜的网站

题目:http://www.51nod.com/onlineJudge/questionCode.html#!problemId1250 仔细思考dp。 第一问,考虑已知 i-1 个数有多少种方案。再放入一个数,它是最大的且在最后面,所以它的位置不同的话,就是不同的方案。它在特定…

访问公司网站公司会知道吗网页设计手机软件

正题 题意 一条长m线&#xff0c;有n条长度不同的线段&#xff0c;查询x到x1有多少条线 解题思路 标记直接覆盖颜色数&#xff0c;然后找到那个点&#xff0c;之后向上到根节点把所有叠加的线统计 代码 #include<cstdio> #include<cstring> using namespace s…

微信如何建立网站做网站的公司重庆

案例分享&#xff1a;作为全球领导者&#xff0c;该财富100强公司以扩大其在移动技术领域的领导力和影响力为使命&#xff0c;该领域是其行业中增长最快的细分市场。公司有超过2,100名工程师、设计师和利益相关者通过使用Jama Connect加速产品开发。 成果概述&#xff1a; •…

网站标准宽度app运营策划

1. T9 输入法的中文字典数据 网上可以找到 T9 输入法的中文字典数据&#xff0c;但是通常有两个问题&#xff1a; 采用 GPL 协议&#xff0c;不太适合加入 AWTK。 只支持单个汉字的输入&#xff0c;不支持词组的输入。 经过考虑之后&#xff0c;决定自己生成 T9 输入法的中…

公司建设网站费用怎么记账志迅东莞网站建设

在大型项目中&#xff0c;Spring Events提供了一种有效的方式来解耦不同的模块&#xff0c;使得系统更加灵活和可扩展。Spring Events基于发布/订阅模式&#xff0c;允许应用的不同部分之间进行通信&#xff0c;而无需直接调用对方的代码。这种方式特别适合于处理那些不需要即时…

微信网站模板源码下载在网上做贸易哪个网站好

线程的概念 前言&#xff1a; 一个程序运行起来&#xff0c;就会对应一个进程&#xff0c;例如&#xff0c;启动一个 Java 程序&#xff0c;就会创建一个 Java 进程。进程也被称为系统分配资源的基本单位。 一个进程可以包含一个线程&#xff0c;也可以包含多个线程&#xff…

外贸汽车配件做那个网站凡氪官网

1 什么是Servlet Servlet是Server Applet的简称&#xff0c;是用Java编写的是运行在 Web 服务器上的程序&#xff0c;它是作为来自 Web 浏览器或其他 HTTP 客户端的请求和 HTTP 服务器上的数据库或应用程序之间的中间层。使用 Servlet&#xff0c;可以收集来自网页表单的用户输…

做个简单网站大概多少钱wordpress 顶部高度

Solus Linux 是一个独立的 Linux 发行版&#xff0c;它以简单易用和现代化的用户体验而著称。Solus Linux 使用的包管理器是 eopkg&#xff0c;它具有以下优势和特点&#xff1a; 用户友好的界面&#xff1a;eopkg 提供了一个简洁直观的命令行界面&#xff0c;使得用户可以轻松…

建设局网站信息发布规定在线制作网站免费

Oracle Receivable 是功能完备地应收款管理系统&#xff0c;它能够有效地管理客户、发票和收帐过程&#xff0c;因此是财务模块的重要组成部分&#xff0c;是财务系统中较为核心的模块之一。对于一个公司来说&#xff0c;是否能够与客户保持良好的跟踪&#xff0c;及时收取应收…