[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Altering the behavior of pcache to improve cache hit/miss ratio
- To: openldap-devel@openldap.org
- Subject: Altering the behavior of pcache to improve cache hit/miss ratio
- From: Ryan Steele <ryan.g.steele@gmail.com>
- Date: Tue, 09 Mar 2010 11:48:48 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:content-type :content-transfer-encoding; bh=RJPxerskub1UOkCvjyH/SYfmJM0eHH/lZ0LBJdapm8g=; b=LlWrmMGWipZOqMXfd+fGwsKKLrSf6hLyzI6D19rptwOeKn8z6eFwdwy6QZ/XBQeOEJ 9c7IRzREpNr+vgKifA9lNGhg6kiqVaa/PXgUIKCgLnUS2pziOk6O6I+W9n1aO1mmdatY eoGx+gjKf/X5MK94eaWBkxyS5E+3AlFY8lvAU=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=OzCqebIf9crPCpn3F3FV8wkfGpI3n9GmlUg/p+U/e/ZcHnT2xGrjt4QoKtSRvjXDgm OljZqhcunoYt1sadj3zRbP2J85jrp4R6wb5eTorXGBPVeNQ3oMJxgwFpTIfEj4Owx18Q d9AcrbUPJie1yErPEavKs+F3Z0FPveMORMa/s=
- User-agent: Thunderbird 2.0.0.19 (X11/20090105)
Hey folks,
I've been playing with pcache for about a week (in combination with back-ldap), testing various things and trying to
create a configuration that helps preserve system stability if access to the LDAP server disappears. Many things seem
to work well, but I noticed that quite a good number of Unix commands, like "id", request a user's full entry (i.e., no
filter string). In its current implementation, this will always fail to hit the cache, because (as the man page states)
you cannot specify an empty list of attributes. This means that even if you have all the information required to return
what was requested in the local cache, you will never be able to leverage that information.
Given that, I wanted to ask if it could be considered to change the design of the overlay a bit, such that if an empty
attribute list is specified, pcache will return every attribute *in the cache* for that entry, instead of blindly
assuming it doesn't have the information to accomplish the task. I understand the shortcomings this could introduce,
most notably if one did not want to cache every attribute for a particular entry and still wanted to be able to omit the
filter string and get the entry's full attribute list, but I think the benefits would make it worthwhile. I say that
for a few reasons: if you're using pcache and are interested in truly optimizing performance or keeping a system that is
LDAP-dependent from having major issues if the network disappears, it would make sense to cache every attribute for
entries used in common system tasks (e.g., using utilities like "id"). I believe this could also significantly improve
the hit/miss ratios, especially if you take a look at how many of these common system utilities make queries without
specifying any kind of filter.
I would think that this could be accomplished by adding a case for the empty filter string, such that it would take a
unison of each set of attributes corresponding to the cached entry for that particular LDAP filter, and returning the
result. If the same attribute is present in more than one cache entry matching the specified LDAP filter, the most
recent would be favored and returned, thereby preventing pcache from having choose between several
query-string-dependent entries for that entry, if more than one are present.
I'm interested to hear what you guys think of this. Even if my implementation ideas aren't 100% spot-on, I would think
that the wiser minds could adapt the general idea in to something more artful, provided they agree with the idea in
principle. Thanks!
-Ryan