admin管理员组

文章数量:1558087


tomcat 性能测试

                

                  

**************

性能测试

            

性能测试指标:响应时间、吞吐量

响应时间:用户执行某个操作的耗时
吞吐量(TPS):每秒执行执行的事务数量

                 

常见测试方式

# 负载测试:正常流量测试
一开始流量很低,随后逐步增加流量,直至应用达到一个较高的负载;
通过增加系统流量,观察随着用户量的增多,响应时间的变化情况

# 压力测试:极端流量测试
使用远超正常数值的流量进行测试,逐步增加流量,直至系统奔溃,不可访问;
通过压力测试,获知系统载在极端情况下可能出现的问题,如:系统奔溃导致的数据不一致等

# 持续运行时间测试
应用系统持续数天不间断运行,模拟正常的用户访问;
在此期间,监测系统响应时间、内存、cpu、磁盘等运行状况;
持续运行时间测试可发现负载测试不易发现的问题,如内存泄漏等

                    

              

**************

性能测试工具

                

***********

ab 测试

             

命令格式:ab [options] url

[root@centos test]# ab -h
Usage: ab [options] [http[s]://]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 conte

本文标签: 性能测试Tomcat