Skip to content

Commit

Permalink
Issue jetty#2130 Creates threadpool module. (jetty#2132)
Browse files Browse the repository at this point in the history
* Creates threadpool module. Resolves jetty#2130

Signed-off-by: WalkerWatch <[email protected]>

* Fixed formatting

Signed-off-by: WalkerWatch <[email protected]>

* Made requested changes.

Signed-off-by: WalkerWatch <[email protected]>

* Additional PR changes.

Signed-off-by: WalkerWatch <[email protected]>

* Udated jetty-threadpool.xml

Signed-off-by: WalkerWatch <[email protected]>
  • Loading branch information
WalkerWatch authored Jan 22, 2018
1 parent fe2be81 commit 0345820
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 37 deletions.
2 changes: 1 addition & 1 deletion jetty-distribution/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@
<arguments>
<argument>jetty.home=${assembly-directory}</argument>
<argument>jetty.base=${assembly-directory}/demo-base</argument>
<argument>--add-to-startd=server,continuation,deploy,websocket,ext,resources,client,annotations,jndi,servlets,jsp,jstl,http,https</argument>
<argument>--add-to-startd=server,continuation,deploy,websocket,ext,resources,client,annotations,jndi,servlets,jsp,jstl,http,https,threadpool</argument>
</arguments>
</configuration>
<goals>
Expand Down
27 changes: 27 additions & 0 deletions jetty-server/src/main/config/etc/jetty-threadpool.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_3.dtd">

<Configure id="threadPool" class="org.eclipse.jetty.util.thread.QueuedThreadPool">

<!-- =========================================================== -->
<!-- Configure the Server Thread Pool. -->
<!-- The server holds a common thread pool which is used by -->
<!-- default as the executor used by all connectors and servlet -->
<!-- dispatches. -->
<!-- -->
<!-- Configuring a fixed thread pool is vital to controlling the -->
<!-- maximal memory footprint of the server and is a key tuning -->
<!-- parameter for tuning. In an application that rarely blocks -->
<!-- then maximal threads may be close to the number of 5*CPUs. -->
<!-- In an application that frequently blocks, then maximal -->
<!-- threads should be set as high as possible given the memory -->
<!-- available. -->
<!-- -->
<!-- Consult the javadoc of o.e.j.util.thread.QueuedThreadPool -->
<!-- for all configuration that may be set here. -->
<!-- =========================================================== -->
<Set name="minThreads" type="int"><Property name="jetty.threadPool.minThreads" deprecated="threads.min" default="10"/></Set>
<Set name="maxThreads" type="int"><Property name="jetty.threadPool.maxThreads" deprecated="threads.max" default="200"/></Set>
<Set name="idleTimeout" type="int"><Property name="jetty.threadPool.idleTimeout" deprecated="threads.timeout" default="60000"/></Set>
<Set name="detailedDump" type="boolean"><Property name="jetty.threadPool.detailedDump" default="false"/></Set>
</Configure>
27 changes: 1 addition & 26 deletions jetty-server/src/main/config/etc/jetty.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,32 +25,7 @@
<!-- =============================================================== -->
<Configure id="Server" class="org.eclipse.jetty.server.Server">

<!-- =========================================================== -->
<!-- Configure the Server Thread Pool. -->
<!-- The server holds a common thread pool which is used by -->
<!-- default as the executor used by all connectors and servlet -->
<!-- dispatches. -->
<!-- -->
<!-- Configuring a fixed thread pool is vital to controlling the -->
<!-- maximal memory footprint of the server and is a key tuning -->
<!-- parameter for tuning. In an application that rarely blocks -->
<!-- then maximal threads may be close to the number of 5*CPUs. -->
<!-- In an application that frequently blocks, then maximal -->
<!-- threads should be set as high as possible given the memory -->
<!-- available. -->
<!-- -->
<!-- Consult the javadoc of o.e.j.util.thread.QueuedThreadPool -->
<!-- for all configuration that may be set here. -->
<!-- =========================================================== -->
<!-- uncomment to change type of threadpool
<Arg name="threadpool"><New id="threadpool" class="org.eclipse.jetty.util.thread.QueuedThreadPool"/></Arg>
-->
<Get name="ThreadPool">
<Set name="minThreads" type="int"><Property name="jetty.threadPool.minThreads" deprecated="threads.min" default="10"/></Set>
<Set name="maxThreads" type="int"><Property name="jetty.threadPool.maxThreads" deprecated="threads.max" default="200"/></Set>
<Set name="idleTimeout" type="int"><Property name="jetty.threadPool.idleTimeout" deprecated="threads.timeout" default="60000"/></Set>
<Set name="detailedDump">false</Set>
</Get>
<Arg name="threadpool"><Ref refid="threadPool"/></Arg>

<!-- =========================================================== -->
<!-- Add shared Scheduler instance -->
Expand Down
13 changes: 3 additions & 10 deletions jetty-server/src/main/config/modules/server.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ ext
resources
logging

[depend]
threadpool

[lib]
lib/servlet-api-3.1.jar
lib/jetty-schemas-3.1.jar
Expand All @@ -20,16 +23,6 @@ lib/jetty-io-${jetty.version}.jar
etc/jetty.xml

[ini-template]
### ThreadPool configuration
## Minimum number of threads
# jetty.threadPool.minThreads=10

## Maximum number of threads
# jetty.threadPool.maxThreads=200

## Thread idle timeout (in milliseconds)
# jetty.threadPool.idleTimeout=60000

### Common HTTP configuration
## Scheme to use to build URIs for secure redirects
# jetty.httpConfig.secureScheme=https
Expand Down
20 changes: 20 additions & 0 deletions jetty-server/src/main/config/modules/threadpool.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[description]
Enables the Server thread pool.

[xml]
etc/jetty-threadpool.xml

[ini-template]

### Server Thread Pool Configuration
## Minimum Number of Threads
#jetty.threadPool.minThreads=10

## Maximum Number of Threads
#jetty.threadPool.maxThreads=200

## Thread Idle Timeout (in milliseconds)
#jetty.threadPool.idleTimeout=60000

## Whether to Output a Detailed Dump
#jetty.threadPool.detailedDump=false

0 comments on commit 0345820

Please sign in to comment.