美文网首页
jmeter(三十一)jmeter优化tips

jmeter(三十一)jmeter优化tips

作者: Sandra_liu | 来源:发表于2022-02-12 20:52 被阅读0次

    1、Run From Commmand Line使用命令行压测
    2、Avoid Listeners 避免使用监听器
    3、Increase JVM Heap Space 增加jvm堆空间
    4、Use the latest jmeter version 使用jmeter最新版本
    5、Use Regexp variable Extractors to extract data from responses 使用正则表达式提取器去提取响应中的数据
    6、Simulate a reasonble amount of threads per machine:avoid simulating more than 1000 users per machine.Usually,the bottleneck is the network connection(1 Gbps on best Cloud instances ). The JVM doesn't wokk well with more than 2000 threads.
    每台机器配置合理数量的线程数 (小于1000个线程数)。
    7、Distribute load over average machines: avoid using few machines with exceptional hardware(like 16 core /128GB RAM ), stick to average machines (4 core ,16GB RAM) and use more machines instead. Jmeter can't take advantage of so much RAM ,because JVMs doesn't work well with Xmx greater than 16GB.
    分布式压测:将负载平均分配到每台机器。
    8、Generate Reports after run:use the outputted JTL files to create reports once the load test is finished. Building the report requires a great amount of CPU and memory resources.
    执行完压测后再生成报告
    9、Network is the bottleneck in most cases:Which means it's better to have medium machines with great network connectivity instead of powerful machines with low network capabilities.
    在大多数情况下网络是个瓶颈
    10、Avoid Beanshell scripts:those scripts use way more CPU to excute than Groovy scripts embedded in
    JSR223 samplers. Stick to JSR223 samplers if you need to run custom logic.
    避免使用beanshell脚本
    11、Do not run in distributed mode:distributed mode works well with 20-30 machines,maybe up to 40-50 machines if you have luck.This will limit you to 20-50k concurrent users. Instesd ,run each Jmeter instance independently by sending the JMX before starting the test, and retrieving the JTL files after finish. The RMI protocol used by jmeter to communicate between the load generators and the conroller is not very efficient.
    不要在分布式模式下执行压测
    12、Monitor tested servers: The key to find performance bottlenecks is to monitor the tested backend servers which running the load test. You will be able to correlate perfomance degradations with server-side issues. This way , you can fix the perfomance issue on backend side quicker. Tools like Perfmon are recommended.
    监控测试发压机和压力机
    13、 Run load tests in-house first: this may sound weird, but the nearer the load generators are from the tested servers, the less factors are likely to influence the performance testing results. On-Premise load tests avoid internet connectivity issues and can use large internal networks (usually 1 to 10 Gbps). Once the servers are well-performing with on-premise testing, testing from the cloud can reveal internet networking issues. This way, you can seperate server issues from network issues.
    先在内网进行压力测试

    相关文章

      网友评论

          本文标题:jmeter(三十一)jmeter优化tips

          本文链接:https://www.haomeiwen.com/subject/zvtukrtx.html