Curently each individual check-in and check-out produces a patron action session (see CIRC-431 and CIRC-559). Those sessions can be closed on UI side: by clicking "End session" button on check-out/check-in screen, or automatically according to configurable inactivity timeout. Behind the scenes, Okapi also attempts to close expired sessions automatically by timer (every 3 minutes) by calling mod-circulation (CIRC-433). For each of these calls circulation picks only one patron and tries to close up to 200 of their sessions, becoming a huge bottleneck in situations where thousands on loans are created for many different patrons over a short period of time, e.g. during data import. This logic needs to be revised to allow faster processing of large amounts of sessions.