winbind: Improve child selection
authorVolker Lendecke <vl@samba.org>
Fri, 9 Feb 2018 09:27:55 +0000 (10:27 +0100)
committerVolker Lendecke <vl@samba.org>
Mon, 12 Feb 2018 18:51:35 +0000 (19:51 +0100)
commitb4384b7f0ecf3b47dd60acaf77636b679e3adc05
tree5de1b69387dc04027e54a00811adc609f17c13af
parentcb920dd8732af30a7f74d5b492ea6ddfc2adfcbd
winbind: Improve child selection

This improves the situation when a client request blocks a winbind
child. This might be a slow samlogon or lookupnames to a domain that's
far away. With random selection of the child for new request coming in
we could end up with a long queue when other, non-blocked children
could serve those new requests. Choose the shortest queue.

This is an immediate and simple fix. Step two will be to have a
per-domain and not a per-child queue. Right now we're pre-selecting
the check-out queue at Fry's randomly without looking at the queue
length. With this change we're picking the shortest queue. The better
change will be what Fry's really does: One central queue and red/green
lights on the busy/free checkout counters.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Feb 12 19:51:35 CET 2018 on sn-devel-144
source3/winbindd/winbindd_dual.c