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

pc端网站怎么做自适应/南宁关键词排名公司

pc端网站怎么做自适应,南宁关键词排名公司,深圳网站开发设计公司排名,青羊网站建设1. ab简介 ab全称Apache Bench,是apache附带的一个小工具,它可以同时模拟多个并发请求,测试apache等Web服务器的最大负载压力。本文通过一个简单的示例,介绍了使用ab进行web页面性能测试、查看结果方法及运行参数详解。运行环境为…

1. ab简介

ab全称Apache Bench,是apache附带的一个小工具,它可以同时模拟多个并发请求,测试apache等Web服务器的最大负载压力。
本文通过一个简单的示例,介绍了使用ab进行web页面性能测试、查看结果方法及运行参数详解。
运行环境为Windows 10系统。

2. ab下载

Apache官网:http://httpd.apache.org/download.cgi

2.1 Windows系统

对于windows系统,可访问页面https://www.apachelounge.com/download/下载相应版本的zip包,我们下载的版本是:httpd-2.4.29-Win64-VC15.zip

 

也可以下载我提取出来的ab.exe,解压即可使用:https://files.cnblogs.com/files/lovesoo/ab.zip

2.2 linux系统

使用如下命令安装Apache
yum install httpd

3. ab运行

使用cmd/shell进入到Apache24\bin目录下,运行ab即可

4. 使用ab进行性能测试

最常用两种运行命令如下:
ab -n 10 -c 10 http://www.cnblogs.com
# -n 总共10次请求,-c 模拟10个并发用户,即10个并发请求博客园首页,共请求10次ab -t 10 -c 10 http://www.cnblogs.com
# -t 是测试执行时间,-c 模拟10个并发用户,即10个并发请求博客园首页,持续10秒

5. 测试结果

 

6. 结果解析

Server Software:
Server Hostname:        www.cnblogs.com
Server Port:            80Document Path:          /
Document Length:        147 bytes    #HTTP响应数据的正文长度Concurrency Level:      10    #并发数
Time taken for tests:   10.183 seconds    #测试执行时间
Complete requests:      169    #完成请求数
Failed requests:        0    #失败请求数
Non-2xx responses:      169
Total transferred:      65403 bytes    #网络总传输量
HTML transferred:       24843 bytes    #HTML内容传输量
Requests per second:    16.60 [#/sec] (mean)    #每秒请求数
Time per request:       602.545 [ms] (mean)    #用户平均请求等待时间,计算公式:测试执行总时间/(总请求数/并发用户数)
Time per request:       60.254 [ms] (mean, across all concurrent requests)    #服务器平均请求等待时间,计算公式:测试执行总时间/总请求数
Transfer rate:          6.27 [Kbytes/sec] received    #平均传输速率Connection Times (ms)    #响应时间小、中、大值min  mean[+/-sd] median   max
Connect:        2   40 325.5      3    3006
Processing:    41  382 928.1     63    3072
Waiting:       41  376 922.1     58    3063
Total:         43  422 971.5     68    3075Percentage of the requests served within a certain time (ms)    #一定时间内请求完成的百分比,如50%用户完成的响应时间在68ms内, 66%用户完成的响应时间在73ms内,100%用户在3075ms内完成50%     6866%     7375%     8180%     8590%   306095%   306698%   306999%   3075100%   3075 (longest request)

7. ab运行参数详解

官方帮助文档如下:
Usage: ab [options] [http://]hostname[:port]/path
Options are:
-n requests Number of requests to perform
-c concurrency Number of multiple requests to make at a time
-t timelimit Seconds to max. to spend on benchmarking
This implies -n 50000
-s timeout Seconds to max. wait for each response
Default is 30 seconds
-b windowsize Size of TCP send/receive buffer, in bytes
-B address Address to bind to when making outgoing connections
-p postfile File containing data to POST. Remember also to set -T
-u putfile File containing data to PUT. Remember also to set -T
-T content-type Content-type header to use for POST/PUT data, eg.
'application/x-www-form-urlencoded'
Default is 'text/plain'
-v verbosity How much troubleshooting info to print
-w Print out results in HTML tables
-i Use HEAD instead of GET
-x attributes String to insert as table attributes
-y attributes String to insert as tr attributes
-z attributes String to insert as td or th attributes
-C attribute Add cookie, eg. 'Apache=1234'. (repeatable)
-H attribute Add Arbitrary header line, eg. 'Accept-Encoding: gzip'
Inserted after all normal header lines. (repeatable)
-A attribute Add Basic WWW Authentication, the attributes
are a colon separated username and password.
-P attribute Add Basic Proxy Authentication, the attributes
are a colon separated username and password.
-X proxy:port Proxyserver and port number to use
-V Print version number and exit
-k Use HTTP KeepAlive feature
-d Do not show percentiles served table.
-S Do not show confidence estimators and warnings.
-q Do not show progress when doing more than 150 requests
-l Accept variable document length (use this for dynamic pages)
-g filename Output collected data to gnuplot format file.
-e filename Output CSV file with percentages served
-r Don't exit on socket receive errors.
-m method Method name
-h Display usage information (this message)
中文翻译如下:
-n 即requests,用于指定压力测试/总请求数。
-c 即concurrency,用于指定压力测试的并发数。
-t 即timelimit,测试执行最大秒数,它可以让测试限制在一个固定的总时间以内,默认值为50000。
-s 即timeout,请求最大等待时长,默认30s
-b 即windowsize,TCP发送/接收的缓冲大小(单位:字节)。
-p 即postfile,发送POST请求时需要上传的文件,文件格式如"p1=1&p2=2"。使用方法是 -p 123.txt 。 (配合-T)
-u 即putfile,发送PUT请求时需要上传的文件。(配合-T)
-T 即content-type,用于设置Content-Type请求头信息,如 -T "application/x-www-form-urlencoded”,默认值为text/plain。(配合-p)
-v 即verbosity,设置显示信息的详细程度 – 4或更大值会显示头信息, 3或更大值可以显示响应代码(404, 200等), 2或更大值可以显示警告和其他信息。
-w 以HTML表格形式打印结果。
-i 使用HEAD请求代替GET请求。
-x 插入字符串作为table标签的属性。
-y 插入字符串作为tr标签的属性。
-z 插入字符串作为td标签的属性。
-C 添加cookie信息,例如:"Apache=1234"。此参数可以重复,用逗号分割。提示:可以借助session实现原理传递 JSESSIONID参数, 实现保持会话的功能,如-C "c1=1234,c2=2,c3=3, JSESSIONID=FF056CD16DA9D71CB131C1D56F0319F8"-H 添加任意的请求头,例如:"Accept-Encoding: gzip",请求头将会添加在现有的多个请求头之后(可以重复该参数选项以添加多个)。
-A 添加一个基本的网络认证信息,用户名和密码之间用英文冒号隔开。
-P 添加一个基本的代理认证信息,用户名和密码之间用英文冒号隔开。如-P proxy-auth-username:password
-X 指定使用的代理服务器和端口号,例如:"126.10.10.3:88"-V 显示版本号并退出。
-k 使用HTTP的KeepAlive特性。
-d 不显示百分比。
-S 不显示预估和警告信息。
-q 超过150个请求后不显示进度
-l 接受可变文档长度(用于动态页面)
-g filename 输出结果信息到gnuplot格式的文件中。
-e filename 输出结果信息到CSV格式的文件中。
-r 指定接收到错误信息时不退出程序。
-m method 方法名
-h 帮助

转载于:https://www.cnblogs.com/lovesoo/p/7762796.html

http://www.jmfq.cn/news/4817107.html

相关文章:

  • 做微信的网站秀客/seo成功案例分析
  • 做厂房出租有那些推广网站/关键词歌词图片
  • 网站代管理/流程优化的七个步骤
  • 网站建设的常用词/石家庄关键词优化平台
  • 泰安网站制作公司电话/香蕉和忘忧草对焦虑的影响
  • 企业为什么要分析环境/360优化大师下载官网
  • 哪个网站做h5比较好/seo营销怎么做
  • 网站建设公司内部情况/专业做网站建设的公司
  • 服装设计网站排行榜前十名/精准营销系统
  • 个人做网站备案多少钱/网站页面优化方案
  • 用php做网站/开通网站需要多少钱
  • 网站做视频的怎么赚钱/网络宣传的好处
  • 怎么看一个网站是什么时候做的/广告推广文案
  • 有利于优化的网站建设/百度平台营销
  • 网站开发毕业答辩/宜昌网站seo
  • 营销型网站建设的指导原则/百度投诉中心电话24个小时
  • html5 网站自适应/零基础怎么做电商
  • 网站策划网/现在阳性最新情况
  • 做网站建设要学多久/网络seo是什么工作
  • 做销售网站的公司哪家最好的/互联网公司
  • 深圳网站制作公司资讯/国外引擎搜索
  • 深圳建设行业网站/天津百度关键词排名
  • 关于设计网站/站长工具app官方下载
  • 武功做网站/优化公司怎么优化网站的
  • wordpress适合下载站的主题/兰州网络seo
  • 潮汕学院网站开发/怎么建网站平台卖东西
  • 个人网站的设计与实现主要技术指标/黄页推广
  • 做网站价格报价费用多少钱/产品运营推广方案
  • 衡水网站建设地方/企业软文代写
  • 圣辉友联做网站公司/企业网站建设要多少钱