From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vs1-xe31.google.com (mail-vs1-xe31.google.com [IPv6:2607:f8b0:4864:20::e31]) by sourceware.org (Postfix) with ESMTPS id 4E45D3858C39 for ; Sun, 24 Jul 2022 13:50:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4E45D3858C39 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=systemhalted.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=systemhalted.org Received: by mail-vs1-xe31.google.com with SMTP id l68so2334115vsc.0 for ; Sun, 24 Jul 2022 06:50:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=systemhalted.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=JAondvNGpe8ghx/zT3qBp8kTsppAlozw9SGIU/2ZY1k=; b=Jh/fWhteOppKdNGcYpdxGpaXK9yooboJI6Cn6LtsyMmFpHg0j/DPQq40VM6+LymjBV HeIS7wyMwSJyg+KONNXVgq7PucOu0Ixerf4mOsicetchNd4c+2duNzOPagDtZpwIuNkr lkYEaY1AJmWv2f4yk/6HEFLHTAABskEW5LCJ8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=JAondvNGpe8ghx/zT3qBp8kTsppAlozw9SGIU/2ZY1k=; b=ssNF0YaDhx4pZl+hAiHhnK/HLgGX+4TT9toQgkJboA+je6udqKAkOESUW1P2qMJ4Za MvCMErvqCbczt+p/EodQ1H7VeQJy6e+JTkw6xiG62XK5HcqlchfXuTi4GRdejNPDtWuG Yb2RYR9XK2RjczQeUMyylK/1J4FzlG8hodoaSzTh/e0aWrHAHVk9yzu8KtwJQrgWhqxg 4plURZieNULNQFG5opxY775LEgaJLXPWib5AH6leGOyoi+x8F53oMLGjfvnJw5n7a77o JWM5akzcgxRD3wxLUPnEdC+lkMTaPAKiukasEjcT/d5T/VvG+hkQALsr5zU9JtgSXuLi AiNQ== X-Gm-Message-State: AJIora97JYtI9EnlyJs8YT9njqItI81i8PkuBWWu2tJK20ouRrP5sqxG hrTYd32XuX09Wdz0U7jqoXyXX+s3fwxy204JznNH1w== X-Google-Smtp-Source: AGRyM1tMfvgaZMm66PXNadldb/Jtt+o5Q6P4q9DZMjJ4EJkoazJ2WCoXaa8dYf6k6dtlhZo1lhQVONHfI9r0LClmdiQ= X-Received: by 2002:a05:6102:1528:b0:354:4e62:a058 with SMTP id f40-20020a056102152800b003544e62a058mr2245110vsv.27.1658670648659; Sun, 24 Jul 2022 06:50:48 -0700 (PDT) MIME-Version: 1.0 References: <268721506430b9d1fa3e1725d230e59b@cmweb01.nm.nfra.io> In-Reply-To: <268721506430b9d1fa3e1725d230e59b@cmweb01.nm.nfra.io> From: "Carlos O'Donell" Date: Sun, 24 Jul 2022 09:50:37 -0400 Message-ID: Subject: Re: How to compile and use 'nscd' To: =?UTF-8?B?7J2067OR7Jqx?= Cc: libc-help Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=2.2 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_INVALID, DKIM_SIGNED, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-help@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-help mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jul 2022 13:50:50 -0000 On Sun, Jul 24, 2022 at 3:57 AM =EC=9D=B4=EB=B3=91=EC=9A=B1 via Libc-help 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 seco= nds. > - 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.