Sun GlassFish Enterprise Server v3 Administration Guide

ProcedureTo Create a Thread Pool

Use the create-threadpool subcommand in remote mode to create a thread pool.

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.

If one resource adapter or application occupies all the Enterprise Server threads, thread starvation might occur. You can avoid this by dividing the Enterprise Server threads into different thread pools.

  1. Ensure that the server is running.

    Remote subcommands require a running server.

  2. Create a new thread pool by using the create-threadpool(1) subcommand.

    Information about options for the subcommand is included in this help page.

  3. To apply your changes, restart Enterprise Server.

    See To Restart a Domain.

    Note –

    Restart is not necessary for thread pools used by the web container.

Example 5–1 Creating a Thread Pool

This example creates threadpool-l.

asadmin> create-threadpool --maxthreadpoolsize 100 
      --minthreadpoolsize 20 --idletimeout 2 --workqueues 100 threadpool-1
Command create-threadpool executed successfully

See Also

You can also view the full syntax and options of the subcommand by typing asadmin help create-threadpool at the command line.