How to compile and use 'nscd'

Carlos O'Donell carlos@systemhalted.org
Sun Jul 24 13:50:37 GMT 2022


On Sun, Jul 24, 2022 at 3:57 AM 이병욱 via Libc-help
<libc-help@sourceware.org> wrote:
>
> I found nscd's dafault ttl should be 15 seconds
>
> because CACHE_PRUNE_INTERVAL is declared as 15.
>
> But it seems hard to modify it and compile nscd and use the customed nscd in my Centos 7.9.
>
> I want to see how nscd works when CACHE_PRUNE_INTERVAL is 1 because I try to use DNS round robin at below environments.
>
> - dns A record www.server.com with 10.1.1.1, 10.1.1.2 with dns ttl 1 seconds.
> - client server with customed nscd, send a request to www.server.com
> - two backend server indicated by 10.1.1.1, 10.1.1.2
>
> Is it possible to use the customed nscd?

It is technically possible to use a customized nscd. However, using a
customized nscd can impact your support through your distribution.

The design goals behind nscd are to cache results locally in as simple
a manner as possible.

The internal hosts cache in nscd is aware of TTL, but the CentOS 7 era
nscd may still have some issues regarding refreshing values based on
TTL.

The value of CACHE_PRUNE_INTERVAL is defined in nscd/nscd.h, and
rebuilding an nscd for your distribution is most easily accomplished
by rebuilding the distribution rpm with a patch added.

The CACHE_PRUNE_INTERVAL drives the loop that prunes the cache, but
other effects prune the cache also, which for the hosts cache should
include the entries ttl.

I suggest evaluating other caching options before changing nscd
though, and you may find it beneficial to look at sssd.

Cheers,
Carlos.


More information about the Libc-help mailing list