]> git.evergreen-ils.org Git - working/SIPServer.git/commit
LP#1339190 Add support for the "Multiplex" personality
authorMike Rylander <mrylander@gmail.com>
Wed, 11 Sep 2013 19:52:00 +0000 (15:52 -0400)
committerMike Rylander <mrylander@gmail.com>
Fri, 5 Dec 2014 17:17:54 +0000 (12:17 -0500)
commit7e4fbac12f6018b4d5a36d7a4360789ced929aa0
tree5d200fe51c128f6e9334da6a61b89cf7358c6824
parenta1480dd80fa122c5221eae51a0be910425baf034
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>
Signed-off-by: Blake GH <blake@mobiusconsortium.org>
SIPServer.pm
SIPconfig.xml
Sip.pm
Sip/Configuration.pm
Sip/MsgType.pm