Sun Java System Application Server Enterprise Edition 8.1 2005Q2 Administration Guide

- Previous: Chapter 13 Configuring the Object Request Broker
- Next: Chapter 15 Configuring Logging

# Chapter 14 Thread Pools

This chapter describes how to create, edit, and delete thread pools. It has the following sections:

- About Thread Pools

- Admin Console Tasks for Thread Pools

# About Thread Pools

This section describes thread pools and how the work in the Application Server.

The Java Virtual Machine (JVM) can support many threads of execution at once. To help performance, the Application Server maintains one or more thread pools. It is possible to assign specific thread pools to connector modules and to the ORB.

One thread pool can serve multiple connector modules and enterprise beans. Request threads handle user requests for application components. When the server receives a request, it assigns the request to a free thread from the thread pool. The thread executes the client's requests and returns results. For example, if the request needs to use a system resource that is currently busy, the thread waits until that resource is free before allowing the request to use that resource.

Specify the minimum and maximum number of threads that are reserved for requests from applications. The thread pool is dynamically adjusted between these two values. The minimum thread pool size that is specified signals the server to allocate at least that many threads in reserve for application requests. That number is increased up to the maximum thread pool size that is specified.

Increasing the number of threads available to a process allows the process to respond to more application requests simultaneously.

Avoid thread starvation, where one resource adapter or application occupies all threads in the Application Server, by dividing the Application Server threads into different thread-pools.

# Admin Console Tasks for Thread Pools

- To create a thread pool

- To edit a thread pool

- To delete a thread pool

## To create a thread pool

1. In the tree component select the Configurations node.

2. Select the instance to configure:

   - To configure a particular instance, select the instance’s config node. For example, the default instance, `server`, select the `server-config` node.

   - To configure the default settings for all instances, select the `default-config` node.

3. Select the Thread Pools node.

4. Under Current Pools click New.

5. Enter the name of the thread pool in the Thread Pool ID field.

6. Enter the minimum number of threads in the thread pool servicing requests in this queue in the Minimum Thread Pool Size field.

   These threads are created up front when this thread pool is instantiated.

7. Enter the maximum number of threads in the thread pool servicing requests in this queue in the Maximum Thread Pool Size field.

   This is the upper limit on the number of threads that exist in the thread pool.

8. Enter the number, in seconds, after which idle threads are removed from pool in the Idle Timeout field.

9. Enter the total number of work queues that are serviced by this thread pool in the Number of Work Queues field.

10. Click OK.

11. Restart the Application Server.

##### Equivalent asadmin command

`create-threadpool`

## To edit a thread pool

1. In the tree component select the Configurations node.

2. Select the instance to configure:

   - To configure a particular instance, select the instance’s config node. For example, the default instance, `server`, select the `server-config` node.

   - To configure the default settings for all instances, select the `default-config` node.

3. Select the Thread Pools node.

4. Under Current Pools select the name of the thread pool to be changed.

5. Enter the minimum number of threads in the thread pool servicing requests in this queue in the Minimum Thread Pool Size field.

   These threads are created up front when this thread pool is instantiated.

6. Enter the maximum number of threads in the thread pool servicing requests in this queue in the Maximum Thread Pool Size field.

   This is the upper limit on the number of threads that exist in the thread pool.

7. Enter the number, in seconds, after which idle threads are removed from pool in the Idle Timeout field.

8. Enter the total number of work queues that are serviced by this thread pool in the Number of Work Queues field.

9. Click Save.

10. Restart the Application Server.

## To delete a thread pool

1. In the tree component, select the Configurations node.

2. Select the instance to configure:

   - To configure a particular instance, select the instance’s config node. For example, the default instance, `server`, select the `server-config` node.

   - To configure the default settings for all instances, select the `default-config` node.

3. Select the Thread Pools node.

4. Check the thread pool name to be deleted in the Current Pools table.

5. Click Delete.

6. Restart the Application Server.

##### Equivalent asadmin command

`delete-threadpool`

- Previous: Chapter 13 Configuring the Object Request Broker
- Next: Chapter 15 Configuring Logging

- © 2010, Oracle Corporation and/or its affiliates