运行大量线程时JMeter问题 [英] JMeter issues when running large number of threads

查看:1541
本文介绍了运行大量线程时JMeter问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Apache的Jmeter进行测试,我只是访问公司网站的一个页面并增加用户数量直到达到阈值,问题是当我达到3000个线程时,JMeter并没有运行所有这些.查看汇总图 它仅运行约2,536个(此数字有所不同,但始终在此处).

I'm testing using Apache's Jmeter, I'm simply accessing one page of my companies website and turning up the number of users until it reaches a threshold, the problem is that when I get to around 3000 threads JMeter doesn't run all of them. Looking at the Aggregate Graph it only runs about 2,536 (this number varies but is always around here) of them.

部分运行在日志中带有以下异常:

The partial run comes with the following exception in the logs:

01:16 ERROR - jmeter.JMeter: Uncaught exception: 
java.lang.OutOfMemoryError: unable to create new native thread
    at java.lang.Thread.start0(Native Method)
    at java.lang.Thread.start(Unknown Source)
    at org.apache.jmeter.threads.ThreadGroup.start(ThreadGroup.java:293)
    at org.apache.jmeter.engine.StandardJMeterEngine.startThreadGroup(StandardJMeterEngine.java:476)
    at org.apache.jmeter.engine.StandardJMeterEngine.run(StandardJMeterEngine.java:395)
    at java.lang.Thread.run(Unknown Source)

此行为是一致的.另外,有一次JMeter在中间崩溃时输出了一个文件,内容为:

This behavior is consistent. In addition one of the times JMeter crashed in the middle outputting a file that said:

# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (malloc) failed to allocate 32756 bytes for ChunkPool::allocate
# Possible reasons:
#   The system is out of physical RAM or swap space
#   In 32 bit mode, the process size limit was hit
# Possible solutions:
#   Reduce memory load on the system
#   Increase physical memory or swap space
#   Check if swap backing store is full
#   Use 64 bit Java on a 64 bit OS
#   Decrease Java heap size (-Xmx/-Xms)
#   Decrease number of Java threads
#   Decrease Java thread stack sizes (-Xss)
#   Set larger code cache with -XX:ReservedCodeCacheSize=
# This output file may be truncated or incomplete.
#
#  Out of Memory Error (allocation.cpp:211), pid=10748, tid=11652
#
# JRE version: 6.0_31-b05
# Java VM: Java HotSpot(TM) Client VM (20.6-b01 mixed mode, sharing windows-x86 )

有什么想法吗?
我尝试在jmeter.bat中更改堆大小,但这似乎无济于事.

Any ideas?
I tried changing the heap size in jmeter.bat, but that didn't seem to help at all.

推荐答案

JVM根本无法运行这么多线程.即使是这样,JMeter也会消耗大量CPU资源来纯粹切换上下文.换句话说,在某些时候,您不是在对Web应用程序进行基准测试,而是在托管JMeter的客户端计算机上进行基准测试.

JVM is simply not capable of running so many threads. And even if it is, JMeter will consume a lot of CPU resources to purely switch contexts. In other words, above some point you are not benchmarking your web application but the client computer, hosting JMeter.

您别无选择:

    具有JVM选项的
  • 实验,例如减小默认将-Xss512K减小一些

  • experiment with JVM options, e.g. decrease default -Xss512K to something smaller

运行集群中的JMeter

使用截然不同的工具,例如加特林

use tools taking radically different approach like Gatling

这篇关于运行大量线程时JMeter问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆