JMeter issues when running large number of threads

前端 未结 6 642
無奈伤痛
無奈伤痛 2020-12-10 04:30

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 t

相关标签:
6条回答
  • 2020-12-10 05:01

    For the JVM, if you read hprof it gives you some solutions among which are:

    • switch to a 64 bits jvm ( > 6_u25)

    • with this you will be able to allocate more Heap (-Xmx) , ensure you have this RAM

    • reduce Xss with:

    -Xss256k

    Then for JMeter, follow best-practices:

    • http://jmeter.apache.org/usermanual/best-practices.html
    • http://www.ubik-ingenierie.com/blog/jmeter_performance_tuning_tips/

    Finally ensure you use last JMeter version.

    • Use linux OS preferably

    • Tune the TCP stack, limits

    Success will depend on your machine power (cpu and memory) and your test plan.

    If this is not enough (for 3000 threads it should be OK), you may need to use distributed testing

    0 讨论(0)
  • 2020-12-10 05:02

    Increasing the heap size in jmeter.bat works fine set HEAP=-Xms1024m -Xmx1024m

    OR you can do something like below if you are using jmeter.sh: JVM_ARGS="-Xms512m -Xmx1024m" jmeter.sh etc.

    0 讨论(0)
  • 2020-12-10 05:05

    I had a similar issue and increased the heap size in jmeter.bat to 1024M and that fixed the issue.

    set HEAP=-Xms1024m -Xmx1024m
    
    0 讨论(0)
  • 2020-12-10 05:09

    I ran into this same problem and the only solution that helped me is: https://stackoverflow.com/a/26190804/5796780

    proper 100k threads on linux:

    ulimit -s  256
    ulimit -i  120000
    echo 120000 > /proc/sys/kernel/threads-max
    echo 600000 > /proc/sys/vm/max_map_count
    echo 200000 > /proc/sys/kernel/pid_max 
    

    If you don't have root access:

    echo 200000 | sudo dd of=/proc/sys/kernel/pid_max
    
    0 讨论(0)
  • 2020-12-10 05:11

    After increasing Xms et Xmx heap size, I had to make my Java run in 64 bits mode. In jmeter.bat :

    set JM_LAUNCH=java.exe -d64
    

    Obviously, you need to run a 64 bits OS and have installed Java 64 bits (see https://www.java.com/en/download/manual.jsp)

    0 讨论(0)
  • 2020-12-10 05:21

    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.

    You have few choices:

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

    • run JMeter in a cluster

    • use tools taking radically different approach like Gatling

    0 讨论(0)
提交回复
热议问题