Ice.ThreadPool.*
A communicator creates two thread pools:
the client thread pool is associated with outgoing connections: it reads Reply messages and executes AMI callbacks; it also reads and dispatches Request messages.
the server thread pool is associated with incoming connections: it reads and dispatches Request messages; it also reads Reply messages and executes AMI callbacks for bidir invocations on these connections.
This page describes configuration properties for the client and server thread pools. These thread pools are named Client
and Server
, respectively. In the property descriptions below, replace name
with Client
or Server
.
Ice.ThreadPool.name.Serialize
Synopsis
Ice.ThreadPool.name.Serialize=num
Description
If num
is a value greater than 0, the Client
or Server
thread pool serializes all messages from each connection. It is not necessary to enable this feature in a thread pool whose maximum size is 1 thread. When a thread pool dispatches requests implemented with AMD, it serializes the dispatching of requests from each connection, but it does not wait for a request to complete before it dispatches the next request.
In a multi-threaded pool, enabling serialization allows requests from different connections to be dispatched concurrently while preserving the order of messages on each connection. Note that serialization can have a significant impact on latency and throughput. If not defined, the default value is 0.
See also: Ice.Connection.MaxDispatches
Ice.ThreadPool.name.Size
Synopsis
Ice.ThreadPool.name.Size=num
Description
Thread pools in Ice can grow and shrink dynamically, based on an average load factor. A thread pool always has at least 1 thread and may grow as load increases up to the maximum size specified by Ice.ThreadPool.name.SizeMax. If SizeMax
is not specified, Ice uses the value of num
as the pool's maximum size. The Client
or Server
thread pool is initialized with num
active threads, but the pool may shrink to only 1 thread during idle periods as determined by Ice.ThreadPool.name.ThreadIdleTime.
If not specified, the default value is 1 for both properties.
To monitor the thread pool activities of the Ice runtime, enable the Ice.Trace.ThreadPool property.
Ice.ThreadPool.name.SizeMax
Synopsis
Ice.ThreadPool.name.SizeMax=num
Description
num
is the maximum number of threads for the Client
or Server
thread pool. Refer to the Ice.ThreadPool.name.Size property for more information on configuring the size of a thread pool.
The default value for SizeMax
is the value of Size
, meaning the thread pool can never grow larger than its initial size.
To monitor the thread pool activities of the Ice runtime, enable the Ice.Trace.ThreadPool property.
Ice.ThreadPool.name.SizeWarn
Synopsis
Ice.ThreadPool.name.SizeWarn=num
Description
Whenever num
threads are active in the Client
or Server
thread pool, a "low on threads" warning is printed. The default value is 0, which disables the warning.
To monitor the thread pool activities of the Ice runtime, enable the Ice.Trace.ThreadPool property.
Ice.ThreadPool.name.ThreadIdleTime
Synopsis
Ice.ThreadPool.name.ThreadIdleTime=num
Description
Ice can automatically reap idle threads in the Client
or Server
thread pool to conserve resources. This property specifies the number of seconds a thread must be idle before it is reaped. If not specified, the default value is 60 seconds.
The threads in Ice thread pools are assigned jobs at random, and this randomness affects how quickly a thread in an under-utilized thread pool will get reaped.
To disable the reaping of idle threads, set ThreadIdleTime
to 0. In this situation, the thread pool is initialized with Ice.ThreadPool.name.Size active threads and may grow to contain Ice.ThreadPool.name.SizeMax active threads, but the size of the pool never decreases.
To monitor the thread pool activities of the Ice runtime, enable the Ice.Trace.ThreadPool property.