ab参数很多,一般我们用 -c 和 -n 参数就可以了. 例如:
./ab -c 100 -n 10000 http://127.0.0.1/index.php
ab(apache benchmark) —— apache自带的一个测试工具,一般把apache压力测试称为AB测试. ab工具的位置在apache的bin目录里,参数说明:
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)
执行测试用例:ab -n 1000 -c 100 -w http://localhost/index.php >>c:\1.html
上面的测试用例表示100并发的情况下,共测试访问index.php脚本1000次,并将测试结果保存到c:\1.html文件中
分析测试结果,可知在该100并发访问的情况下,共测试访问1000次,失败了xxx次。进而可知该脚本在此环境是否可以满足100并发访问的要求,然后通过调节并发数并重新检查失败次数,可得出在多少并发下系统可正常工作。
对于java开发人员也可学习下 apache的另外一个测试工具,Apache性能测试工具:JMeter
网站:http://jmeter.apache.org
因疫情原因,需要统计人员动态,因数据量较大,将根据用户id 存入不同的表中,如下有两个表,现在需要根据某个条件查询统计数据,我们可以用union all 将结果集合并在一起。下面是联合两个表查询语句:select count(*) as sum1 from retrun_factory emp_id='S20190001' union allselect count(*) as su...
欢迎转载:http://blog.csdn.net/fylz1125/article/details/8498603一般打飞机类游戏都是飞机不动,背景图滚动,造成飞机在天空飞的效果。MoonWarriors的背景有两层,一个远景天空,一个近景漂浮物,这两层背景滚动速度不一样,形成一种纵深感。如图:图有点模糊,实际效果跟html5的一样(根本就是照着它写的,嘿嘿)
载入数据到Pandas1.索引:将一个列或多个列读取出来构成DataFrame,其中涉及是否从文件中读取索引以及列名2.类型推断和数据转换:包括用户自定义的转换以及缺失值标记3.日期解析4.迭代:针对大文件进行逐块迭代。这个是Pandas和Python原生的csv库的最大区别5.不规则数据整理问题:跳过一些行,或注释等等1索引及列名pd.read_csv('D:\python0917\zrx0917.csv')%more D:\python0917\zrx0917.csvpd.read t
我正在为嵌入式设备编写自定义Linux PCIe驱动程序.为此,我需要启用多个MSI向量.当我使用函数pci_enable_msi(pdev)时,代码正常工作.但是当我使用pci_enable_msi_block(pdev,4)时;该函数返回1表示它只能分配1个中断.如果我使用pci_enable_msi_block(pdev,32);函数返回16,我使用pci_enable_msi_block(...
随着计算机技术和网络技术的快速发展,计算机及其相关应用已经渗透到社会的各个领域,加快、推动了社会信息化的进程,同时也使得信息社会对人才需求不断提高。下面是小编为大家整理的,供大家参考。范文一:计算机基础教育教学改革与创新摘要:社会的发展和进步使人们的生活水平不断提升,在当前环境下,各行各业对计算机技术的应用也越来越多,这也就需要更多的计算机专业的人才。所以在当今时期,为了迎合时下的环境和社会发展现...
( A 卷)一、填空题(每空1分,共20分)1、信号设备的接地电阻值不大于欧姆。2、双机热备系统中,双机之间的通信采用通信方式。3、计算机联锁系统中的总线一般分为三类,即、、和。4、计算机联锁系统软件按照层次结构可分为层、层和层。5、计算机联锁系统中联锁数据包括和两大类,其中联锁静态数据结构有和。6、联锁机与执行层的联系方式有和两种方式。7、TYJL-II型计算机联锁系统其联锁机双机切换有和两种控...
关于IDEA工具中Junit测试无法读取键盘录入的解决办法一、问题背景二、解决办法一、问题背景许多初次使用IDEA 这款开发工具的朋友有可能会遇到这样一个问题,在eclipse上可以正常运行的junit测试读取键盘录入,到了idea上怎么就不行了,这里先不去深究这其中的原因,而是直接解决这个问题。二、解决办法这里解决办法考虑到了新安装时候的软件设置和使用一段时间之后的配置选择,需要注意的是,如果是已使用一段时间之后,则下面所有步骤都要做,如果刚安装,则可以只做第一步骤就可以,如果启动之后没有效果,也
开发过程中为了避免返回键回退之前页面问题,需要我们做一个管理类,来管理我们的classpublic class ActivityCollector { public static List<Activity> activities = new ArrayList<>(); public static void addActivity(Activity......
一.基础查询1.dao层(1)代码块/** * 使用hql语句注解进行查询操作 * hql:from cn.pojo.Customer where custName = ? * 使用query注解 */@Query(value = "from cn.pojo.Customer where custName = ?")public Customer findByName(String custName);(2)范例2.测试类(1)代码块import cn.dao.Customer
微信公众号开发之js-sdk首先申请一个测试号,然后进行配置。话不多说,直接上图:其中这里的url和token是需要自己定义的,url要确保能跟外网能访问,是一个地址,微信后台能进行访问和验证,确保能跟外网联通。其实就是一个你自己后台写的接口,不过这个接口参数要根据微信定义。我的url是:http://xxx.xxx/sanboxRequestParam结构如下:@Datapub...
使用element 中的DateTimePicker 日期时间选择器选择日期后向后台发送请求时间报JSON parse error: Cannot deserialize value of type java.time.LocalDateTime from String日期格式不对,但后端对日期格式做过处理看了element官网,它有一个属性可以转换日期格式加上后问题解决...
原文转载自http://cwqqq.com/2020/09/27/apple_login_api_server_sideapple帐号登录服务器端接入最近有新产品要提交App Store,发现APP审核增加了接入apple帐号登录的要求。所以,借此机会研究下apple帐号登录,做一个分享。Sign In With Apple这是苹果推出一套标准接口,用户通过端上的Apple ID登录第三方APP。官方网址 https://developer.apple.com/document.