A Glacier2 router can forward requests in buffered or unbuffered mode. In addition, the buffering mode can be set independently for each direction (client-to-server and server-to-client).
The configuration properties Glacier2.Client.Buffered and
Glacier2.Server.Buffered govern the buffering behavior. The former affects buffering of requests from clients to servers, and the latter affects buffering of requests from servers to clients. If a property is not specified, the default value is
1, which enables buffering. A property value of
0 selects the unbuffered mode.
In unbuffered mode, the router forwards an incoming request in the same thread that received the request. This mode uses fewer resources than buffered mode, but it also has some limitations:
However, for some applications, the lower resource requirements of the unbuffered mode are attractive enough to warrant a careful application design that addresses this mode’s limitations.
In buffered mode, the router queues incoming requests and creates an extra thread (or two
1) dedicated to processing the request queue of each connected client. While buffered mode consumes more resources than unbuffered mode, it does not suffer the limitations of unbuffered mode described in
Section 43.8.1. Furthermore, buffered mode offers some additional functionality not available in unbuffered mode, such as the ability to batch requests (see
Section 43.9.3).
The configuration properties Glacier2.Client.SleepTime and
Glacier2.Server.SleepTime can be used to ensure that a single client or server, respectively, does not flood the router with requests. A non-zero value causes the router’s thread dedicated to a connection to sleep for the specified number of milliseconds after it has sent all of the pending requests. Incoming requests are queued while the connection’s thread is asleep.