GithubHelp home page GithubHelp logo

Comments (8)

ingojaeckel avatar ingojaeckel commented on June 2, 2024

Hey @alanroche,

thanks for reporting this! That sounds like a regression in 1.0.6. Can you confirm if this was working fine on 1.0.5?

Thanks,
Ingo

from gatling-aws-maven-plugin.

alanroche avatar alanroche commented on June 2, 2024

I tried with a 1.0.6-SNAPSHOT which we believe was working OK before (on a different machine).
We get the same results.

Going to try on 1.0.5 next

from gatling-aws-maven-plugin.

alanroche avatar alanroche commented on June 2, 2024

OK, so the same issue is there on 1.0.5, - but after some investigation I have found the problem and solution/workaround.

This had a few of us stuck for a day or two, - so it would be very helpful to others to make a note in the README.mds as a gotcha, - hopefully others may then come to a quicker solution if they run into it.
It was a tricky one to track down and could burn a lot of time for other users.

The issue comes from SSH generating secure random numbers using a native (OS) random number generator. We are running on VMs so it is likely that this is also a problem that is exasperated by running from a VM, - hard to say for sure thoughj

The problem is basically this:
https://issues.jenkins-ci.org/browse/JENKINS-20108
http://stackoverflow.com/questions/137212/how-to-solve-performance-problem-with-java-securerandom

The culprit thread in the stack trace is this:

"pool-4-thread-2" #25 prio=5 os_prio=0 tid=0x00007f0e1493b800 nid=0x860 runnable [0x00007f0dcbb92000] java.lang.Thread.State: RUNNABLE at java.io.FileInputStream.readBytes(Native Method) at java.io.FileInputStream.read(FileInputStream.java:255) at sun.security.provider.NativePRNG$RandomIO.readFully(NativePRNG.java:410) at sun.security.provider.NativePRNG$RandomIO.implGenerateSeed(NativePRNG.java:427) - locked <0x00000000e0c432e0> (a java.lang.Object) at sun.security.provider.NativePRNG$RandomIO.access$500(NativePRNG.java:329) at sun.security.provider.NativePRNG.engineGenerateSeed(NativePRNG.java:224) at java.security.SecureRandom.generateSeed(SecureRandom.java:533) at net.schmizz.sshj.transport.random.BouncyCastleRandom.<init>(BouncyCastleRandom.java:44) at net.schmizz.sshj.transport.random.BouncyCastleRandom$Factory.create(BouncyCastleRandom.java:36) at net.schmizz.sshj.transport.random.BouncyCastleRandom$Factory.create(BouncyCastleRandom.java:31) at net.schmizz.sshj.transport.random.SingletonRandomFactory.<init>(SingletonRandomFactory.java:27) at net.schmizz.sshj.DefaultConfig.initRandomFactory(DefaultConfig.java:117) at net.schmizz.sshj.DefaultConfig.<init>(DefaultConfig.java:93) at net.schmizz.sshj.SSHClient.<init>(SSHClient.java:143) at com.ea.gatling.SshClient.getSshClient(SshClient.java:115) at com.ea.gatling.SshClient.executeCommand(SshClient.java:55) at com.ea.gatling.AwsGatlingExecutor.runGatlingTest(AwsGatlingExecutor.java:114) at com.ea.gatling.AwsGatlingExecutor.run(AwsGatlingExecutor.java:141) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)

There are a few solutions:
urandom actually seems to work OK, - the problem for us seems to be that it is using /dev/random and not urandom.

  • Set -Djava.security.egd=file:/dev/urandom in MAVEN_OPTS
  • Comment out securerandom.source=file:/dev/random $JAVA_HOME/lib/security/java.security
  • OR : Update securerandom.source to file:/dev/urandom *
    ^ No this isn't a typo with the DOT apparently you need it otherwise java rewrites it to /dev/./random !!!!
    Later this evening, I will look into whether there is a way to incorporate this into the code as a fix, - if even just to detect the scenario and issue a warning.

from gatling-aws-maven-plugin.

ingojaeckel avatar ingojaeckel commented on June 2, 2024

Thanks for your investigation on this! Can you post more information about your environment e.g. JDK version, OS, Jenkins version, Maven version?

from gatling-aws-maven-plugin.

alanroche avatar alanroche commented on June 2, 2024
  • JDK/JRE 8u92
  • Happens on both CentOS 6.8 and Ubuntu 16.04
  • Maven 3.3.9

I will need to check Jenkins version in the morning when I get back into the office, -though the issue isn't really related to Jenkins. Interesting though that they(Jenkins) encountered the same issue with Jenkins slaves which would also be over SSH.

from gatling-aws-maven-plugin.

alanroche avatar alanroche commented on June 2, 2024

Some more info:
https://docs.oracle.com/cd/E13209_01/wlcp/wlss30/configwlss/jvmrand.html

from gatling-aws-maven-plugin.

petrvlcek avatar petrvlcek commented on June 2, 2024

Hi,

I'm not sure if this is the same problem, but I have experienced very low performance of SSH client when running load tests on Jenkins.

I have successfully resolved this issue by reusing SSH configuration for all subsequent creations of SSH client. My solution is in pull request #17 if you are interested.

from gatling-aws-maven-plugin.

ingojaeckel avatar ingojaeckel commented on June 2, 2024

closing this since @petrvlcek 's PR got merged at the end of 2016. let me know if this is still an issue @alanroche

from gatling-aws-maven-plugin.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.