From 817d004cd58505045e72f65ce81fdd429edc3077 Mon Sep 17 00:00:00 2001 From: Ben Hale Date: Tue, 8 Jan 2019 15:51:46 -0800 Subject: [PATCH] Stack Threads Documentation This change adds some additional documentation pointing out that non-blocking runtimes such as Netty require many fewer threads and that you should probably configuration your container appropriately. [resolves #666] Signed-off-by: Ben Hale --- README.md | 2 +- docs/jre-open_jdk_jre.md | 7 +++---- docs/jre-oracle_jre.md | 7 +++---- docs/jre-sap_machine_jre.md | 7 +++---- docs/jre-zulu_jre.md | 8 ++++---- 5 files changed, 14 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 1074164aa8..91b9a353ba 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ The following are _very_ simple examples for deploying the artifact types that w The buildpack default configuration can be overridden with an environment variable matching the configuration file you wish to override minus the `.yml` extension and with a prefix of `JBP_CONFIG`. It is not possible to add new configuration properties and properties with `nil` or empty values will be ignored by the buildpack (in this case you will have to extend the buildpack, see below). The value of the variable should be valid inline yaml, referred to as "flow style" in the yaml spec ([Wikipedia][] has a good description of this yaml syntax). For example, to change the default version of Java to 7 and adjust the memory heuristics apply this environment variable to the application. ```bash -$ cf set-env my-application JBP_CONFIG_OPEN_JDK_JRE '{ jre: { version: 1.7.0_+ }, memory_calculator: { stack_threads: 200 } }' +$ cf set-env my-application JBP_CONFIG_OPEN_JDK_JRE '{ jre: { version: 11.+ }, memory_calculator: { stack_threads: 25 } }' ``` If the key or value contains a special character such as `:` it should be escaped with double quotes. For example, to change the default repository path for the buildpack. diff --git a/docs/jre-open_jdk_jre.md b/docs/jre-open_jdk_jre.md index 3073c3d4e5..0e4ce416c7 100644 --- a/docs/jre-open_jdk_jre.md +++ b/docs/jre-open_jdk_jre.md @@ -110,15 +110,14 @@ headroom: 10 #### Stack Threads -The amount of memory that should be allocated to stacks is given as an amount of memory per -thread with the Java option `-Xss`. If an explicit number of -threads should be used for the calculation of stack memory, then it should be specified as in -the following example: +The amount of memory that should be allocated to stacks is given as an amount of memory per thread with the Java option `-Xss`. If an explicit number of threads should be used for the calculation of stack memory, then it should be specified as in the following example: ```yaml stack_threads: 500 ``` +Note that the default value of 250 threads is optimized for a default Tomcat configuration. If you are using another container, especially something non-blocking like Netty, it's more appropriate to use a significantly smaller value. Typically 25 threads would cover the needs of both the server (Netty) and the threads started by the JVM itself. + #### Java Options If the JRE memory settings need to be fine-tuned, the user can set one or more Java memory options to diff --git a/docs/jre-oracle_jre.md b/docs/jre-oracle_jre.md index d408384d3c..dd1d8cc98b 100644 --- a/docs/jre-oracle_jre.md +++ b/docs/jre-oracle_jre.md @@ -126,15 +126,14 @@ headroom: 10 #### Stack Threads -The amount of memory that should be allocated to stacks is given as an amount of memory per -thread with the Java option `-Xss`. If an explicit number of -threads should be used for the calculation of stack memory, then it should be specified as in -the following example: +The amount of memory that should be allocated to stacks is given as an amount of memory per thread with the Java option `-Xss`. If an explicit number of threads should be used for the calculation of stack memory, then it should be specified as in the following example: ```yaml stack_threads: 500 ``` +Note that the default value of 250 threads is optimized for a default Tomcat configuration. If you are using another container, especially something non-blocking like Netty, it's more appropriate to use a significantly smaller value. Typically 25 threads would cover the needs of both the server (Netty) and the threads started by the JVM itself. + #### Java Options If the JRE memory settings need to be fine-tuned, the user can set one or more Java memory options to diff --git a/docs/jre-sap_machine_jre.md b/docs/jre-sap_machine_jre.md index c7d171f2d4..fd4bbe66d0 100644 --- a/docs/jre-sap_machine_jre.md +++ b/docs/jre-sap_machine_jre.md @@ -113,15 +113,14 @@ headroom: 10 #### Stack Threads -The amount of memory that should be allocated to stacks is given as an amount of memory per -thread with the Java option `-Xss`. If an explicit number of -threads should be used for the calculation of stack memory, then it should be specified as in -the following example: +The amount of memory that should be allocated to stacks is given as an amount of memory per thread with the Java option `-Xss`. If an explicit number of threads should be used for the calculation of stack memory, then it should be specified as in the following example: ```yaml stack_threads: 500 ``` +Note that the default value of 250 threads is optimized for a default Tomcat configuration. If you are using another container, especially something non-blocking like Netty, it's more appropriate to use a significantly smaller value. Typically 25 threads would cover the needs of both the server (Netty) and the threads started by the JVM itself. + #### Java Options If the JRE memory settings need to be fine-tuned, the user can set one or more Java memory options to diff --git a/docs/jre-zulu_jre.md b/docs/jre-zulu_jre.md index 2f1b601a96..2ca78809d1 100644 --- a/docs/jre-zulu_jre.md +++ b/docs/jre-zulu_jre.md @@ -117,15 +117,15 @@ headroom: 10 #### Stack Threads -The amount of memory that should be allocated to stacks is given as an amount of memory per -thread with the Java option `-Xss`. If an explicit number of -threads should be used for the calculation of stack memory, then it should be specified as in -the following example: +The amount of memory that should be allocated to stacks is given as an amount of memory per thread with the Java option `-Xss`. If an explicit number of threads should be used for the calculation of stack memory, then it should be specified as in the following example: ```yaml stack_threads: 500 ``` +Note that the default value of 250 threads is optimized for a default Tomcat configuration. If you are using another container, especially something non-blocking like Netty, it's more appropriate to use a significantly smaller value. Typically 25 threads would cover the needs of both the server (Netty) and the threads started by the JVM itself.hreads: 500 +``` + #### Java Options If the JRE memory settings need to be fine-tuned, the user can set one or more Java memory options to