[Date Prev][Date Next] [Chronological] [Thread] [Top]

(ITS#4717) Efficient handling of response lists in C-API



Full_Name: Pierangelo Masarati
Version: HEAD
OS: irrelevant
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (81.72.89.40)
Submitted by: ando


In proxies, we occasionally need to mark some response messages as "don't care".
 This is slightly different than "abandon", in the sense that, for performance
and band occupation, an abandon would likely get too late to the remote server,
but if the response is not removed from the list that would grow and waste
resources.

In realistic cases we profiled proxies that spend 50-60% of the CPU time running
the list of messages to check if any of them has been abandoned.

The proposed fix consists in:

- keeping abandoned msgid's sorted, so that a bisection algorithm can be used to
check if a msgid has been abandoned

- add a ldap_int_abandon() call that marks a message as "abandoned" without
actually sending an "abandon" operation.  This call is, by now, private
(ldap_int_) since its use in normal clients would make little sense.  However,
whenever it does make sense, there's no objection in making the call public
(sort of ldap_abandon_mark()).

With this change, the overall CPU used to check response list in the very same
test cases dropped to less than 1%.

p.