Skip to content

Conversation

@schneems
Copy link
Contributor

Currently we don’t know the max bound of the pool_capacity metric. We know spawned which is confusingly under the “running” keyword, however we don’t know if spawned is the highest it will possibly be.

By adding max_threads we know the upper bound for running threads and therefore the upper bound for pool capacity.

It should be noted that it’s not always guaranteed that puma will always create up to max_threads, a separate relationship between running and max_threads should be monitored as well (if min threads != max threads).

@schneems schneems force-pushed the schneems/max-thread-metric branch from 18d6e62 to fb2ca4c Compare June 29, 2018 17:33
Currently we don’t know the max bound of the `pool_capacity` metric. We know `spawned` which is confusingly under the “running” keyword, however we don’t know if spawned is the highest it will possibly be.

By adding `max_threads` we know the upper bound for `running` threads and therefore the upper bound for pool capacity.

It should be noted that it’s not always guaranteed that puma will always create up to `max_threads`, a separate relationship between `running` and `max_threads` should be monitored as well (if min threads != max threads).
@schneems
Copy link
Contributor Author

This is my failure:

TestBinder#test_binder_parses_jruby_ssl_options = rake aborted!
Command failed with status (1)
/home/travis/build/puma/puma/vendor/bundle/jruby/2.3.0/gems/rake-12.3.1/exe/rake:27:in `<main>'
/home/travis/.rvm/gems/jruby-9.1.17.0/gems/bundler-1.16.2/lib/bundler/cli/exec.rb:1:in `(root)'
/home/travis/.rvm/gems/jruby-9.1.17.0/gems/bundler-1.16.2/lib/bundler/cli/exec.rb:74:in `kernel_load'
/home/travis/.rvm/gems/jruby-9.1.17.0/gems/bundler-1.16.2/lib/bundler/cli/exec.rb:28:in `run'
/home/travis/.rvm/gems/jruby-9.1.17.0/gems/bundler-1.16.2/lib/bundler/cli.rb:424:in `exec'
/home/travis/.rvm/gems/jruby-9.1.17.0/gems/bundler-1.16.2/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/home/travis/.rvm/gems/jruby-9.1.17.0/gems/bundler-1.16.2/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/home/travis/.rvm/gems/jruby-9.1.17.0/gems/bundler-1.16.2/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
/home/travis/.rvm/gems/jruby-9.1.17.0/gems/bundler-1.16.2/lib/bundler/cli.rb:27:in `dispatch'
/home/travis/.rvm/gems/jruby-9.1.17.0/gems/bundler-1.16.2/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `block in start'
/home/travis/.rvm/gems/jruby-9.1.17.0/gems/bundler-1.16.2/lib/bundler/cli.rb:18:in `start'
/home/travis/.rvm/gems/jruby-9.1.17.0/gems/bundler-1.16.2/exe/bundle:30:in `<main>'
/home/travis/.rvm/gems/jruby-9.1.17.0/gems/bundler-1.16.2/lib/bundler/friendly_errors.rb:124:in `<eval>'
/home/travis/.rvm/gems/jruby-9.1.17.0/bin/jruby_executable_hooks:24:in `<main>'
Tasks: TOP => default => test:all => test
(See full trace by running task with --trace)

Any ideas? Seems unrelated.

@schneems
Copy link
Contributor Author

Can't run locally due to different unrelated error:

⛄  2.3.3 🚀  ~/documents/projects/puma (schneems/max-thread-metric)
$ ruby -v
jruby 9.1.17.0 (2.3.3) 2018-04-20 d8b1ff9 Java HotSpot(TM) 64-Bit Server VM 25.40-b25 on 1.8.0_40-b25 +jit [darwin-x86_64]
$ be rake test TEST=test/test_binder.rb
mkdir -p tmp/java/puma_http11
javac -extdirs "/Users/rschneeman/Library/Java/Extensions:/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home/jre/lib/ext:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java" -target 1.5 -source 1.5 -Xlint:unchecked  -cp "/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home/jre/lib/sunrsasign.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home/jre/classes:/Users/rschneeman/.rubies/jruby-9.1.17.0/lib/jruby.jar:" -d tmp/java/puma_http11 ext/puma_http11/PumaHttp11Service.java ext/puma_http11/org/jruby/puma/Http11.java ext/puma_http11/org/jruby/puma/Http11Parser.java ext/puma_http11/org/jruby/puma/MiniSSL.java
warning: [options] bootstrap class path not set in conjunction with -source 1.5
warning: [options] source value 1.5 is obsolete and will be removed in a future release
warning: [options] target value 1.5 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
Note: ext/puma_http11/org/jruby/puma/Http11.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
4 warnings
touch tmp/java/puma_http11/.build
jar cf tmp/java/puma_http11/puma_http11.jar -C tmp/java/puma_http11 org/jruby/puma/Http11\$1.class -C tmp/java/puma_http11 org/jruby/puma/Http11\$2.class -C tmp/java/puma_http11 org/jruby/puma/Http11\$3.class -C tmp/java/puma_http11 org/jruby/puma/Http11\$4.class -C tmp/java/puma_http11 org/jruby/puma/Http11\$5.class -C tmp/java/puma_http11 org/jruby/puma/Http11\$6.class -C tmp/java/puma_http11 org/jruby/puma/Http11\$7.class -C tmp/java/puma_http11 org/jruby/puma/Http11\$8.class -C tmp/java/puma_http11 org/jruby/puma/Http11\$9.class -C tmp/java/puma_http11 org/jruby/puma/Http11.class -C tmp/java/puma_http11 org/jruby/puma/Http11Parser\$ElementCB.class -C tmp/java/puma_http11 org/jruby/puma/Http11Parser\$FieldCB.class -C tmp/java/puma_http11 org/jruby/puma/Http11Parser\$HttpParser.class -C tmp/java/puma_http11 org/jruby/puma/Http11Parser.class -C tmp/java/puma_http11 org/jruby/puma/MiniSSL\$1.class -C tmp/java/puma_http11 org/jruby/puma/MiniSSL\$2.class -C tmp/java/puma_http11 org/jruby/puma/MiniSSL\$MiniSSLBuffer.class -C tmp/java/puma_http11 org/jruby/puma/MiniSSL\$SSLOperation.class -C tmp/java/puma_http11 org/jruby/puma/MiniSSL.class -C tmp/java/puma_http11 puma/PumaHttp11Service.class
install -c tmp/java/puma_http11/puma_http11.jar lib/puma/puma_http11.jar
Run options: --seed 60297

# Running:

SSSrake aborted!
Command failed with status (1)
/Users/rschneeman/.gem/jruby/2.3.3/gems/rake-12.3.0/exe/rake:27:in `<main>'
/Users/rschneeman/.gem/jruby/2.3.3/gems/bundler-1.16.2/lib/bundler/cli/exec.rb:1:in `(root)'
/Users/rschneeman/.gem/jruby/2.3.3/gems/bundler-1.16.2/lib/bundler/cli/exec.rb:74:in `kernel_load'
/Users/rschneeman/.gem/jruby/2.3.3/gems/bundler-1.16.2/lib/bundler/cli/exec.rb:28:in `run'
/Users/rschneeman/.gem/jruby/2.3.3/gems/bundler-1.16.2/lib/bundler/cli.rb:424:in `exec'
/Users/rschneeman/.gem/jruby/2.3.3/gems/bundler-1.16.2/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/Users/rschneeman/.gem/jruby/2.3.3/gems/bundler-1.16.2/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/Users/rschneeman/.gem/jruby/2.3.3/gems/bundler-1.16.2/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
/Users/rschneeman/.gem/jruby/2.3.3/gems/bundler-1.16.2/lib/bundler/cli.rb:27:in `dispatch'
/Users/rschneeman/.gem/jruby/2.3.3/gems/bundler-1.16.2/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `block in start'
/Users/rschneeman/.gem/jruby/2.3.3/gems/bundler-1.16.2/lib/bundler/cli.rb:18:in `start'
/Users/rschneeman/.gem/jruby/2.3.3/gems/bundler-1.16.2/exe/bundle:30:in `<main>'
/Users/rschneeman/.gem/jruby/2.3.3/bin/bundle:23:in `<main>'
Tasks: TOP => test
(See full trace by running task with --trace)

@schneems
Copy link
Contributor Author

schneems commented Jul 2, 2018

Tests on master are borked for jruby, needs investigation.

@schneems schneems merged commit 7f71af4 into master Jul 2, 2018
@nateberkopec nateberkopec deleted the schneems/max-thread-metric branch March 14, 2020 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants