LP#
1339190 Add support for the "Multiplex" personality
We use Net::Server::Multiplex to reduce resource consumption. In
this mode, SIPServer will maintain connection state in the main
listening process and fork workers as needed to handle individual
requests.
Initial implementation by Mike Rylander, with a conversion from
File::Queue to Memcache, and LOTS of debugging, by Bill Erickson.
Some highlights:
* A fork fence for max concurrent in-flight requests
* Allow the ILS to save state in IO::Multiplex mode
* Optimistic login using fork-and-check
When a SIP child process is spawned to handle a new connection login,
the pending login is tracked in the parent process (by PID) and the
child indicates to the parent that the login has succeeded by storing
login success/failure plus some state information in memcache. Any time
the parent wakes up to process a message, it checks for completed logins
so they can be resolved as OK in the parent and the state information
is extracted and stored for future conversation with the resolved client.
* Let workers hang around for a bit for higher-rate clients
For some clients, such as AMH (sorters), the per-message connections
cause too much latency. So, instead, we'll let their backends hang
around for a while. This is controlled by a new attribute on the
server-params element, worker-keepalive, as a peer to the personality
value. This value can also be set on the institution and login elements
to support finer-grained keepalive tuning.
This is measured in seconds and the default is 5. A value of 0 here
will disable this feature altogether.
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Conflicts:
SIPServer.pm
Sip/MsgType.pm
Signed-off-by: Blake GH <blake@mobiusconsortium.org>