1. Thread Management Commands
The following is a list of thread management commands.
Command | Description |
---|---|
Sends an interrupt signal to a servlet or an EJB RMI thread. |
|
Dynamically changes the thread pool dedicated to a server. |
|
Dynamically changes the system thread pool. |
|
Displays stack traces of a servlet thread or an EJB RMI thread. |
|
Displays information about a service thread pool that uses the system thread pool of a server. |
|
Displays the system thread pool information of a server. |
|
Displays information about servlet threads or EJB RMI threads that handle requests. |
1.1. interrupt-thread
Sends an interrupt signal to a servlet or an EJB RMI thread. For more information about the result of sending an interrupt signal to a thread, refer to Thread monitoring and control in JEUS Server Guide.
This function only sends an interrupt signal. It does not guarantee that the thread stops its operation. |
-
Alias
interruptthread, interrupt, intthread
-
Usage
interrupt-thread [-server <server-name>] -ctx <web-context-name> | -wc <Web Connection Name> | <thread-id> [-svg <Service Group Name>]
-
Parameters
Parameter Description [-server <server-name>]
Server name.
-ctx <web-context-name> | -wc <web-connection-name> | <thread-id>
-
-ctx <web-context-name>: If the thread pool that will be interrupted is at the context level, the context name is set as an argument.
-
-wc: If the thread pool that will be interrupted is at the web-connction level, the web-connection name is set as an argument.
-
<thread-id>: ID of the thread to which the signal is sent.
-svg <Service Group Name>
Name of the thread pool at the context level. Only available when the -ctx option is specified. If not, all thread pools at the context level are interrupted.
-
-
Example
[MASTER]domain1.adminServer>interrupt-thread -server server1 50 Sent an interrupt hint signal to the thread [tid=50] on the server server1.
1.2. modify-service-thread-pool
Dynamically changes the thread pool dedicated to a server. This command applies only for the naming server, scheduler, and the transaction thread pool that use the current integrated configuration. If the configuration is unspecified, this command displays the current configuration.
-
Alias
modify-svctp, modifysvctp, svctpconfig, svctpconf
-
Usage
modify-service-thread-pool -service <service name> <server-name> [-min <min>] [-max <max>] [-k,--keepalivetime <keep-alive-time>] [-q,--queuesize <queue-size>] [-m,--maxstuckthreadtime <max-stuck-thread-time>] [-a,--actiononstuckthread <action-on-stuck-thread>] [-stcp,--stuckthreadcheckperiod <stuck-thread-check-period>] [-f,--forceLock] [-detail]
-
Parameters
Parameter Description -service <service name>
Service name that uses the system thread pool.
Input options:
-
transaction
-
scheduler
-
namingserver
<server-name>
Server name.
[-min <min>]
[Dynamic] Minimum number of threads in the thread pool.
[-max <max>]
[Dynamic] Maximum number of threads in the thread pool.
[-k,--keepalivetime <keep-alive-time>]
[Dynamic] If the number of threads is greater than the minimum number, threads idle for a specified period of time are deleted.
[-q,--queuesize <queue-size>]
Maximum number of worker threads in a queue.
[-m,--maxstuckthreadtime <max-stuck-thread-time>]
[Dynamic] Determines a thread to be in the STUCK state if the execution time of the thread exceeds the specified period.
[-a,--actiononstuckthread <action-on-stuck-thread>]
[Dynamic] Method for handling threads in the STUCK state.
Input options:
-
IgnoreAndReplace
-
Interrupt
-
None
[-stcp,--stuckthreadcheckperiod <stuck-thread-check-period>]
[Dynamic] Sets the interval at which to check threads in the STUCK state. (Unit: ms)
[-f,--forceLock]
Forcibly applies the configuration changes.
[-detail]
Displays detailed results of the dynamic changes.
-
-
Example
88% [MASTER]domain1.adminServer>modify-service-thread-pool server1 -service transaction -min 10 -max 20 Successfully performed the MODIFY operation for The transaction thread pool of the server (server1)., but all changes were non-dynamic. They will be applied after restarting. Check the results using "show-service-thread-pool server1 -service transaction or modify-service-thread-pool server1 -service transaction"
1.3. modify-system-thread-pool
Dynamically changes the system thread pool. This command can modify the number of threads allocated to services that use the system thread pool.
-
Alias
modify-systp, modifysystp, systpconfig, systpconf
-
Usage
modify-system-thread-pool <server-name> [-min <min>] [-max <max>] [-k,--keepalivetime <keep-alive-time>] [-q,--queuesize <queue-size>] [-m,--maxstuckthreadtime <max-stuck-thread-time>] [-a,--actiononstuckthread <action-on-stuck-thread>] [-stcp,--stuckthreadcheckperiod <stuck-thread-check-period>] [-service <service-name>] [-r,--reservednum <reserved-number>] [-f,--forceLock] [-detail]
-
Parameters
Parameter Description <server-name>
Server name.
[-min <min>]
[Dynamic] Minimum number of threads in the thread pool.
[-max <max>]
[Dynamic] Maximum number of threads in the thread pool.
[-k,--keepalivetime <keep-alive-time>]
[Dynamic] If the number of threads is greater than the minimum number, threads remaining idle for a specified period of time are deleted.
[-q,--queuesize <queue-size>]
Maximum number of worker threads in a queue.
[-m,--maxstuckthreadtime <max-stuck-thread-time>]
[Dynamic] Determines a thread to be in the STUCK state if the execution time of the thread exceeds the specified period.
[-a,--actiononstuckthread <action-on-stuck-thread>]
[Dynamic] Method for handling threads in the STUCK state.
Input options:
-
IgnoreAndReplace
-
Interrupt
-
None
[-stcp,--stuckthreadcheckperiod <stuck-thread-check-period>]
[Dynamic] Sets the interval at which to check threads in the STUCK state. (Unit: ms)
[-service <service-name>]
Service name that uses the system thread pool.
Input options:
-
transaction
-
scheduler
-
namingserver
[-r,--reservednum <reserved-number>]
[Dynamic] Minimum number of threads allocated to services that use the system thread pool.
[-f,--forceLock]
Forcibly applies the configuration changes.
[-detail]
Displays detailed results of the dynamic changes.
-
-
Example
85% [MASTER]domain1.adminServer>modify-system-thread-pool server1 -min 10 -max 60 -service transaction -reservednum 20 -detail Successfully performed the MODIFY operation for the system thread pool of the server (server1). ================================================================================ +-----------------------------------------------------------+-------+----------+ | servers.server.{? name == 'server1' }.systemThreadPool | MODIFY| ACTIVATED| | servers.server.{? name == 'server1' }.tmConfig | MODIFY| ACTIVATED| +-----------------------------------------------------------+-------+----------+ ================================================================================ Check the results using "modify-system-thread-pool server1 or show-system-thread -pool server1" ------------------details------------------- servers.server.{? name == 'server1' }.tmConfig : ACTIVATED servers.server.{? name == 'server1' }.tmConfig.pooling : ACTIVATED servers.server.{? name == 'server1' }.tmConfig.pooling.shared : ACTIVATED servers.server.{? name == 'server1' }.tmConfig.pooling.shared.reservedThreadNum : ACTIVATED previous value : 0, edited value : 20, result value : 20 servers.server.{? name == 'server1' }.systemThreadPool : ACTIVATED servers.server.{? name == 'server1' }.systemThreadPool.min : ACTIVATED previous value : 0, edited value : 10, result value : 10 servers.server.{? name == 'server1' }.systemThreadPool.max : ACTIVATED previous value : 100, edited value : 60, result value : 60
1.4. print-stack-trace
Displays stack traces of a servlet thread or an EJB RMI thread.
-
Alias
stacktrace, strace
-
Usage
print-stack-trace [-server <server-name>] -ctx <web-context-name> | -wc <Web Connection Name> | <thread-id> [-svg <Service Group Name>]
-
Parameters
Parameter Description [-server <server-name>]
Server name.
-ctx <web-context-name> | -wc <web-connection-name> | <thread-id>
-
-ctx <web-context-name>: If the thread pool is at the context level when it displays stack traces, the context name is set as an argument.
-
-wc: If the thread pool is at the web-connction level when it displays stack traces, the web-connection name is set as an argument.
-
<thread-id>: Thread ID.
-svg <Service Group Name>
Name of the thread pool at the context level. Only available when the -ctx option is specified. If not, stack traces of all thread pools at the context level are displayed.
-
-
Example
[MASTER]domain1.adminServer>print-stack-trace -server server1 50 servlet thread [tid=50] Stack trace of http1-1 [server1-50] tid=50 java.lang.Thread.State: WAITING at sun.misc.Unsafe.park(Native Method) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:156) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987) at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:399) at jeus.util.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1291) at jeus.servlet.engine.WebThreadPoolExecutor.getTask(WebThreadPoolExecutor.java:68) at jeus.util.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:1215) at jeus.servlet.engine.WebThreadPoolExecutor$WebRequestWorker.run(WebThreadPoolExecutor.java:332) at java.lang.Thread.run(Thread.java:662)
1.5. show-service-thread-pool
Displays the system thread pool information of a server.
-
Alias
show-svctp, showsvctp
-
Usage
show-service-thread-pool <server-name> -service <service-name>
-
Parameters
Parameter Description <server-name>
Server name.
-service <service-name>
Service name.
Input options:
-
transaction
-
scheduler
-
namingserver
-
-
Example
[MASTER]domain1.adminServer>show-service-thread-pool server1 -service transaction Shows the current configuration. ===================================================================== +----------------------------------------------------------+--------+ | Min | 10 | | Max | 20 | | Keep-Alive Time | 60000 | | Queue Size | 4096 | | Max Stuck Thread Time | 3600000| | Action On Stuck Thread | NONE | | Stuck Thread Check Period | 300000 | +----------------------------------------------------------+--------+ =====================================================================
1.6. show-system-thread-pool
Displays the system thread pool information of a server.
-
Alias
show-systp, showsystp
-
Usage
show-system-thread-pool <server-name> [-service <service-name>]
-
Parameters
Parameter Description <server-name>
Server name.
[-service <service-name>]
Service name.
Input options:
-
transaction
-
scheduler
-
namingserver
-
-
Example
[MASTER]domain1.adminServer>show-system-thread-pool server1 Shows the current configuration. the system thread pool of the server (server1). ====================================================================== +------------------------------------------------------------+-------+ | Min | 10 | | Max | 60 | | Keep-Alive Time | 300000| | Queue Size | 4096 | | Max Stuck Thread Time | 0 | | Action On Stuck Thread | NONE | | Stuck Thread Check Period | 300000| | Reserved Threads for the Service transaction | 0 | +------------------------------------------------------------+-------+ ======================================================================
1.7. thread-info
Displays information about servlet threads or EJB RMI threads that handle requests and about other JEUS thread pools.
For servlets, information about the listener’s thread pool and each worker thread can be checked. For EJB, information about EJB RMI threads that handle remote requests can be checked. From the server, information about server thread pools can be basically checked, and information about all pools can be checked as well depending on the selected option. For batch applications, the information of configured thread pool can be checked.
-
Alias
threadinfo, ti
-
Usage
thread-info -server <server-name> [-type <thread-type>] [-wc <web-connection-name> | -ctx <web-context-name>] [-r,--request | -a,--all] [-s <thread-state>] [-os,--only-stats] [-st,--stacktrace]
-
Parameters
Parameter Description -server <server-name>
Server name.
[-type <thread-type>]
Input options:
-
servlet : Servlet Thread
-
ejb : EJB RMI Thread
-
jms : JMS Thread
-
server : Server Thread Pool
-
batch: Thread pool used in the batch application
If the -ctx option is specified, enter the following values.
-
context: Context Thread Pool
-
webasync: Thread pool for servlet 3.0 async processing
-
upgrade: Thread pool for Async Send of WebSocket Container or HTTP Upgrade NIO Servlet
[-wc <web-connection-name> | -ctx <context-name>]
Specifies a web connection or web context. If a web connection is specified, its thread pool information is displayed. If a web context is specified, a desired thread pool can be specified. For no option specified, all information of Context, WebAsync, and WebSocket Thread Pool is displayed.
[-r,--request | -a,--all]
-
-r: Checks only the request information of the servlet thread. Valid only for servlet threads.
-
-a: For servlets, checks the information of all servlet threads. For servers, checks the information about all thread pools within JEUS.
[-s <thread-state>]
To search for threads in a specific state, enter the state.
-
active
-
idle
-
blocked
-
reconn
[-os,--only-stats]
Servlet only displays statistical information by listener. Server displays only statistical information of pools.
[-st,--stacktrace]
Searches the traces of all active threads (thread currently running for actual tasks) that belong to the pools searched by the server. This option only applies to servers.
-
-
Example
[MASTER]domain1.adminServer>thread-info -server server1 Thread information for the server [server1] There are no EJB RMI threads for the server [server1]. There is no batch thread pool in server [server1]. ============================================================= The web engine threads for 'ADMIN-HTTP'. +----+------------------------------+--------+---------+----+ | tid| name | state | elapsed | uri| +----+------------------------------+--------+---------+----+ | 45 | ADMIN-HTTP-w00 | waiting| 48521870| | +----+------------------------------+--------+---------+----+ elsapsed: Elapsed time (ms) ============================================================= =================================================================== Thread statistics for the 'ADMIN-HTTP'. +---------------------------+------+-------+-----+--------+-------+ | | total| active| idle| blocked| reconn| +---------------------------+------+-------+-----+--------+-------+ | The number of threads. | 1 | 0 | 1 | 0 | 0 | +---------------------------+------+-------+-----+--------+-------+ total = active + idle, reconn: reconnecting =================================================================== ===================================================== The web engine threads for 'http1'. +------+--------------------+--------+---------+----+ | tid | name | state | elapsed | uri| +------+--------------------+--------+---------+----+ | 46 | http1-w00 | waiting| 48521873| | | 47 | http1-w01 | waiting| 48521868| | | 48 | http1-w02 | waiting| 48521868| | | 49 | http1-w03 | waiting| 48521868| | | 51 | http1-w05 | waiting| 48521862| | | 52 | http1-w06 | waiting| 48521858| | | 53 | http1-w07 | waiting| 48521858| | | 54 | http1-w08 | waiting| 48521857| | | 55 | http1-w09 | waiting| 48521857| | | 21203| http1-w10 | waiting| 37629 | | +------+--------------------+--------+---------+----+ elsapsed: Elapsed time (ms) ===================================================== =================================================================== Thread statistics for the 'http1'. +---------------------------+------+-------+-----+--------+-------+ | | total| active| idle| blocked| reconn| +---------------------------+------+-------+-----+--------+-------+ | The number of threads. | 10 | 0 | 10 | 0 | 0 | +---------------------------+------+-------+-----+--------+-------+ total = active + idle, reconn: reconnecting =================================================================== ====================================================================== The threads for the 'threadpool.System' thread pool. +-----+------------------------------+---------------+---------------+ | tid | name | thread state | active thread | +-----+------------------------------+---------------+---------------+ | 93 | threadpool.System-2 | TIMED_WAITING | false | | 92 | threadpool.System-1 | TIMED_WAITING | false | | 94 | JMXMP [adminServer-94] | RUNNABLE | true | +-----+------------------------------+---------------+---------------+ ====================================================================== ================================================================================ The statistics for the 'threadpool.System' thread pool. +-----------+-----------+-----------+-----------+----------+-------------------+ | pool name | minimum | maximum | current | work | remaining work | | | pool size | pool size | pool size |queue size| queue size | +-----------+-----------+-----------+-----------+----------+-------------------+ | threadpool| 0 | 100 | 3 | 4096 | 4096 | |.System | | | | | | +-----------+-----------+-----------+-----------+----------+-------------------+ ================================================================================ ========================================================== The threads for the 'chunk_checkpoint' thread pool. +-----+------+--------------+----------------------------+ | tid | name | thread state | active thread | +-----+------+--------------+----------------------------+ (No data available) ========================================================== ================================================================================ The statistics for the 'chunk_checkpoint' thread pool. +-----------+-----------+-----------+-----------+----------+-------------------+ | pool name | minimum | maximum | current | work | remaining work | | | pool size | pool size | pool size |queue size| queue size | +-----------+-----------+-----------+-----------+----------+-------------------+ | chunk_che | 0 | 10 | 0 | 4096 | 4096 | |ckpoint | | | | | | +-----------+-----------+-----------+-----------+----------+-------------------+ ================================================================================