Code Monkey home page Code Monkey logo

cob_spec's People

Contributors

aaronlahey avatar anteaya avatar cdemyanovich avatar chongkim avatar cmvandrevala avatar damonkelley avatar dcmoore avatar ecmendenhall avatar esmevane avatar felipesere avatar hnlee avatar jneander avatar kevbuchanan avatar kevinliddle avatar macroexpanse avatar markpearlcoza avatar marosluuce avatar mateuadsuara avatar mathpunk avatar mikeebert avatar mylesmegyesi avatar patrickgombert avatar paulwpagel avatar paytonrules avatar samsaradog avatar swalker- avatar takagoto avatar tamminhdao avatar trptcolin avatar ukutaht avatar

Watchers

 avatar

cob_spec's Issues

`TimeToComplete` test crashes on High Sierra at 4096 threads

I have confirmed that gohttp is - in fact - handling requests concurrently, through use of simultaneous,
long-running netcat connections. Spawning a goroutine to handle each request made it possible to connect with a
second netcat instance, while the first was still connected.

I am, however, having difficulty getting the TimeToComplete spec to run on Go 1.10 / OSX High Sierra in what appears
to be the intended fashion - with 4096 concurrent requests. The spec is currently implemented in such manner as to
spawn 4096 threads all at once, and I don't see a way to get that to work on High Sierra.

When running it through the web page, the error looks like this:

__EXCEPTION__:java.lang.OutOfMemoryError: unable to create new native thread
    at java.lang.Thread.start0(Native Method)
    at java.lang.Thread.start(Thread.java:717)
    at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:957)
    at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1367)
    at java.util.concurrent.AbstractExecutorService.invokeAll(AbstractExecutorService.java:238)
    at SimultaneousHttpBrowsers.execute(SimultaneousHttpBrowsers.java:42)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at fitnesse.slim.fixtureInteraction.DefaultInteraction.methodInvoke(DefaultInteraction.java:16)
    at fitnesse.slim.MethodExecutor.callMethod(MethodExecutor.java:43)
    at fitnesse.slim.MethodExecutor.invokeMethod(MethodExecutor.java:30)
    at fitnesse.slim.MethodExecutor.findAndInvoke(MethodExecutor.java:52)
    at fitnesse.slim.FixtureMethodExecutor.execute(FixtureMethodExecutor.java:18)
    at fitnesse.slim.StatementExecutor.getMethodExecutionResult(StatementExecutor.java:218)
    at fitnesse.slim.StatementExecutor.call(StatementExecutor.java:207)
    at fitnesse.slim.Statement.callMethodAtIndex(Statement.java:104)
    at fitnesse.slim.Statement.call(Statement.java:97)
    at fitnesse.slim.Statement.execute(Statement.java:77)
    at fitnesse.slim.ListExecutor$Executive.executeStatement(ListExecutor.java:44)
    at fitnesse.slim.ListExecutor$Executive.executeStatements(ListExecutor.java:39)
    at fitnesse.slim.ListExecutor.execute(ListExecutor.java:71)
    at fitnesse.slim.SlimServer.executeInstructions(SlimServer.java:81)
    at fitnesse.slim.SlimServer.processTheInstructions(SlimServer.java:73)
    at fitnesse.slim.SlimServer.processOneSetOfInstructions(SlimServer.java:57)
    at fitnesse.slim.SlimServer.tryProcessInstructions(SlimServer.java:43)
    at fitnesse.slim.SlimServer.serve(SlimServer.java:30)
    at fitnesse.slim.SlimService.accept(SlimService.java:98)
    at fitnesse.slim.SlimService.startWithFactory(SlimService.java:39)
    at fitnesse.slim.SlimService.main(SlimService.java:26)

If you run the test from the command line instead of from the web page, the error looks a little different:

F 10:42:39 R:0    W:1    I:0    E:2    TimeToComplete   (HttpTestSuite.SimultaneousTestSuite.TimeToComplete)    0.001 seconds
. 10:42:39 R:0    W:0    I:0    E:0    SuiteTearDown    (HttpTestSuite.SuiteTearDown)   0.001 seconds
Could not detect death of command line test runner.
java.lang.IllegalThreadStateException: process hasn't exited
        at java.lang.UNIXProcess.exitValue(UNIXProcess.java:423)
        at fitnesse.components.CommandRunner.join(CommandRunner.java:79)
        at fitnesse.responders.run.slimResponder.SlimTestSystem.bye(SlimTestSystem.java:208)
        at fitnesse.responders.run.MultipleTestsRunner.startTestSystemAndExecutePages(MultipleTestsRunner.java:118)
        at fitnesse.responders.run.MultipleTestsRunner.internalExecuteTestPages(MultipleTestsRunner.java:88)
        at fitnesse.responders.run.MultipleTestsRunner.executeTestPages(MultipleTestsRunner.java:60)
        at fitnesse.responders.run.SuiteResponder.performExecution(SuiteResponder.java:57)
        at fitnesse.responders.run.TestResponder.doExecuteTests(TestResponder.java:72)
        at fitnesse.responders.run.TestResponder.doSending(TestResponder.java:63)
        at fitnesse.responders.ChunkingResponder.startSending(ChunkingResponder.java:66)
        at fitnesse.http.ChunkedResponse.sendTo(ChunkedResponse.java:26)
        at fitnesse.http.MockResponseSender$OutputStreamSender.doSending(MockResponseSender.java:57)
        at fitnesse.FitNesse.executeSingleCommand(FitNesse.java:106)
        at fitnesseMain.FitNesseMain.executeSingleCommand(FitNesseMain.java:74)
        at fitnesseMain.FitNesseMain.runFitNesse(FitNesseMain.java:64)
        at fitnesseMain.FitNesseMain.updateAndLaunch(FitNesseMain.java:55)
        at fitnesseMain.FitNesseMain.launchFitNesse(FitNesseMain.java:43)
        at fitnesseMain.FitNesseMain.main(FitNesseMain.java:27)

It's trying to create 4096 native threads at once and send them off and running, and that's weird in and of itself on a machine with the capability
to run no more than a dozen threads at a time. A solution that is less dependent upon the capabilities and configuration of the host system
would involve creating one Task per request and using a fixed thread pool to issue them concurrently.

As a workaround, I tried the following approaches:

  • Increasing the JVM maximum memory (-Xmx512m) and decreasing the thread stack size (-Xss512k), with no change in results.
  • ulimit -u 4096, but the maximum value allowed is somewhere around 2,000.
  • ulimit -s 512, with no change in results.
  • Apache Bench 2.3 run as ab -c 8 -n 4096 'http://127.0.0.1:5000/', which
    • is outdated, but updating it seems to be non-trivial since I can not locate a binary to download for OSX
    • appears to have bugs related to mechanism it's using to issue concurrent requests
    • about 2-3 out of 4 runs, it works perfectly and shows a throughput in the neighborhood of 10,000 requests per second
    • about once in every 3 or 4 runs, hangs for about 30 seconds

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.