Frequently Asked Questions
By default, the Ice server-side run time uses a thread pool to dispatch incoming requests. The number of requests that can execute concurrently in a server is limited to the number of threads in the pool. If more clients attempt to concurrently call operations than there are threads in the pool, the corresponding requests are not dispatched until a currently executing invocation completes and returns its thread to the pool; that thread then picks up the next pending request.
By default, the server-side thread pool has a size of one, meaning that only one operation can execute in the server at a time. If you don’t see concurrent invocations in a server, it is likely that the server is running with a thread pool containing only a single thread, thereby serializing all incoming invocations.
The size of the server-side thread pool is controlled by a number of properties:
- Ice.ThreadPool.Server.Size
- Ice.ThreadPool.Server.SizeMax
- Ice.ThreadPool.Server.SizeWarn
The Ice.ThreadPool.Server.Size property controls the number of threads in the pool. When you create a communicator, the specified number of threads are created and added to the pool; the size of the pool never drops below this number of threads.
The Ice.ThreadPool.Server.SizeMax property has a default value that equals the size of the thread pool. However, you can set this property to a value that is larger than Ice. ThreadPool.Server.Size. If you do, the server-side run time will allow the thread pool to grow in size up to this value if enough requests arrive concurrently. The run time also dynamically shrinks the thread pool back to its initial size as demand on threads is reduced (with some hysteresis to avoid continuously creating and destroying threads).
Finally, the Ice.ThreadPool.Server.SizeWarn property sets a threshold. If the number of threads in use exceeds this value, the run time emits a warning via the communicator’s logger. The default value of this property is 80% of the value specified by Ice.ThreadPool.Server.SizeMax.