From patchwork Thu Aug 5 22:10:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Banks X-Patchwork-Id: 44595 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 87BF6384F009 for ; Thu, 5 Aug 2021 22:10:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 87BF6384F009 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1628201456; bh=PTAmefV7YdyHssP96U94ZhKkp0jog6l307d02LijxtU=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=H5fKN7eSZOpMmdh4A/QuS5M2UAWQjRERY+hSGio8bXXaaadG46B1GRK/IELbnvpOo ZYs/d1GiQdB0YF2eoHH+1vb8OZ3MXk+aVRwguQLR6K+yYh1Ruqhk9j+uhwJxWP3GQA 9xUZ9KDLAhloQTO5/wkcAetRykSVhaiX09zbjDbM= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail523.linkedin.com (mail523.linkedin.com [108.174.6.123]) by sourceware.org (Postfix) with ESMTPS id 876D33858434 for ; Thu, 5 Aug 2021 22:10:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 876D33858434 Received: from [2a01:111:f400:7eaa::209] ([2a01:111:f400:7eaa::209.36537] helo=NAM11-DM6-obe.outbound.protection.outlook.com) by mail523.prod.linkedin.com (envelope-from ) (ecelerity 3.6.21.53563 r(Core:3.6.21.0)) with ESMTPS (cipher=ECDHE-RSA-AES256-GCM-SHA384 subject="/C=US/ST=Washington/L=Redmond/O=Microsoft Corporation/CN=mail.protection.outlook.com") id A4/56-26186-7D16C016; Thu, 05 Aug 2021 22:10:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YlyqCLba4RQ1d52CKPI2gJUu/a31WO64zJ/IlKUaM/yyZWGR0h29RmJ2XcKtDkEApTZnnSLuqTJouUzn57cM9yPrLEEF9zDxKDN1At6UWPHsYyh0x5Yx3hlOC40K9KRfW9UR6v88sYhZ1wC28dUhgRPNz0jRGe/u4pd3KWcG4iZhkHD8meCXil57A2BqCksrEGo7PzkY7vcQU4roIfHgaaIbjNuGtjXNr4hIT4wPbH8WSCiM95p8zyFOU+o5Cp1NDTOV4mDQc1OfXvxIMjMQ1lRSioTvouZzMpyfYnEnpfYkwnhjnk20lr/KZOqUHkx5ovjJuaXehC3kF80rjKmRUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PTAmefV7YdyHssP96U94ZhKkp0jog6l307d02LijxtU=; b=WxdN7RdXhsSthNUGUjUg0zOQpYFE2SuXskTHw4FWi6dIW4buiQF+T7iovNd8PcrRxlVN5bWLL4eHNfSWaFixdJ+nOOTKaPS9YAnwC16+VuMwp8G+z+WO22CIMUfmxfB2CDkBNmHHWDa/NKFBNpGPZm18gummaxhtccfa7SQvMk5LTbottFniAmQysKD8g8IeJRWqF3k4HDdStJ6TtNuuyq4gZsPu/OkLyPnKe9PhkTjAVS10Kd6nhoQy1g8s56S2h5wCwH/PbXo3S2LuKzdxGb/+/+TbjGwSdug5NHvRXOeka+RSLSed4v1NfB8MfnS5vzijH3bc7SPvn2ZmIEUqpQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=linkedin.com; dmarc=pass action=none header.from=linkedin.com; dkim=pass header.d=linkedin.com; arc=none Received: from BL0PR2101MB1316.namprd21.prod.outlook.com (2603:10b6:208:92::10) by BL0PR2101MB0977.namprd21.prod.outlook.com (2603:10b6:207:30::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.3; Thu, 5 Aug 2021 22:10:29 +0000 Received: from BL0PR2101MB1316.namprd21.prod.outlook.com ([fe80::85a0:b805:1191:bb82]) by BL0PR2101MB1316.namprd21.prod.outlook.com ([fe80::85a0:b805:1191:bb82%9]) with mapi id 15.20.4415.007; Thu, 5 Aug 2021 22:10:29 +0000 To: "Alejandro Colomar (man-pages)" Subject: nscd.conf.5: describe reloading, clarifications, v4 Thread-Topic: nscd.conf.5: describe reloading, clarifications, v4 Thread-Index: AQHXikYM0CeYUayWUEqBTRUBJkCElQ== Date: Thu, 5 Aug 2021 22:10:29 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=True; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2021-08-05T22:10:29.138Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=General; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 5df52a79-d760-493b-8716-08d9585dd608 x-ms-traffictypediagnostic: BL0PR2101MB0977: x-microsoft-antispam-prvs: x-o365ent-eop-header: Message Processed By - CBR_LInkedIn_Mail_To_External x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 6uyKGEOEEJb6m1WI1we8tt9vqDPqRsUlfdiNe+32favuzF90yQ2alHMIxTfy3F7n5iu3/AIp6kvRwMHuLTQu35mN69NazwcY/pZRKgUpjuNr1SdIiBX7LXzqfVG7AWvhq5appViom9U8yOktUxxf4xlIfvdd1cSzDKQC7AeGMFhENgUmF6tNcrqqSijnEC9WRd9TOqzivvGCBAQA/fzKTUSU/VZ2oZWCeKReFKPkYAQePMEjUd74C7Eh39KKqaQxfmuodMSGmd1RarbkkgjyQnbrhvuaHf4VA5x6pwy0JhRtX10Cd7JZerqFCM7AONP1ZuPiIiBWj9MDNKjAMqxd933Rsi7THMDT2Fv+KlVPUmFyfn+NNSH3NC9qykpa3sCFhhJ2Qai4R7HhsWeUgXOe6Ni2RMJkZuBsK03JJAvhugQRteAKIWDrwak2GwIR0KxyjVrvIrPeVk7p16FqSNZ44a7PVrc8ynqLiBRE7EdejUGM0W3MX0pQZvOpA/uvok4mfl552WTQNR3wj8tLwy7PEyLhjXnqHszQ0IfbQqC//+nnUqEid2d5BoO16LAdRQFXsmCldTOcCclHmlrMF+75CloWopiK3rAkmnd9glz/UibaYUAHfBwrQw5yZH/P+8TAvvDFTnms9tuwV/FHozjQ0chBMSFpOOw4J/quW8v9ogQXvcew1ExYyyDKShA/UpVWHNR5rvv67n95b5ytbvvkJydh4q3YPzv8xbWLwydriwAyWg7CsW82DE3HCCp3oMy/ x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BL0PR2101MB1316.namprd21.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(8990500004)(66446008)(66476007)(66946007)(508600001)(4326008)(71200400001)(76116006)(38070700005)(5660300002)(26005)(64756008)(186003)(6506007)(33656002)(52536014)(7696005)(6916009)(66556008)(8936002)(8676002)(316002)(54906003)(86362001)(55016002)(38100700002)(83380400001)(9686003)(122000001)(2906002)(82960400001)(82950400001)(2004002)(134885004); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?J9O0fP8qVFXYboOt/dR4Jmq?= =?iso-8859-1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LpeT7dFPAUbiVvY9nL0ZwCLY7I1IziR6f1YRU1gyHl?= =?iso-8859-1?q?RIkiUn4mhUl4hvvlGKVvOEt92YgMKzlSNRJUddKL+c/bL59148y1aZKZk09v?= =?iso-8859-1?q?3G/BdB7Ne56vCs9sUGzOFlr6RnAYBGdl7woHuAUTaQqHpCUT3ycvRtkvVCq2?= =?iso-8859-1?q?hglIVvoPbLP15/myuargGfKeb6q/t3sWV+/BgEmcgYtxWu6AzbqwEpaGbY+1?= =?iso-8859-1?q?15HZ221gCpt6tdKSh0bMsijeLfoXfVvuY2G3FP0qLuHmNVsQvGUL/JI224uf?= =?iso-8859-1?q?fHezTTI3QkjGOfD2ZO7lCaFOlrIJ9iW5TdCSnUSMdW3V93qKWD93xNL97doH?= =?iso-8859-1?q?nQtDO2w98fwZpqUzglOPx+E6p2s7JKyeOA9T7n1xjjl/2huvikiR2FUvV4A2?= =?iso-8859-1?q?Bu28XGWY7QKxlP2B72jjMhoU0lN8VZ2ElEl+JIa8=3D?= x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-OriginatorOrg: linkedin.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BL0PR2101MB1316.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5df52a79-d760-493b-8716-08d9585dd608 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Aug 2021 22:10:29.4666 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 7jSp8P0M6vmbL73oEFJCJVVrxrzZXFr7n2YJqYAJZE+x0lZ+p1/WlRvyrOb87+3fACcvCaKgOTnXUoWySE+gdQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR2101MB0977 X-Spam-Status: No, score=-8.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, LINKEDIN_RECEIVED, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Greg Banks via Libc-alpha From: Greg Banks Reply-To: Greg Banks Cc: "linux-man@vger.kernel.org" , "libc-alpha@sourceware.org" , Michael Kerrisk Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" The following changes since commit fbe71b1b79e72be3b9afc44b5d479e7fd84b598a: ioctl_tty.2: wfix (2021-07-26 01:31:54 +0200) are available in the Git repository at: git@github.com:gnb/man-pages.git nscd.conf.5.v4 for you to fetch changes up to 2cb4e042b6aee518f1673d8897fd06056bd87767: nscd.conf.5: describe reloading, clarifications, v4 (2021-08-05 15:07:20 -0700) ---------------------------------------------------------------- Greg Banks (1): nscd.conf.5: describe reloading, clarifications, v4 man5/nscd.conf.5 | 112 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 109 insertions(+), 3 deletions(-) diff --git a/man5/nscd.conf.5 b/man5/nscd.conf.5 index 7356bf7c2..9635922fd 100644 --- a/man5/nscd.conf.5 +++ b/man5/nscd.conf.5 @@ -1,5 +1,6 @@ .\" Copyright (c) 1999, 2000 SuSE GmbH Nuernberg, Germany .\" Author: Thorsten Kukuk +.\" Updates: Greg Banks Copyright (c) 2021 Microsoft Corp. .\" .\" %%%LICENSE_START(GPLv2+_SW_3_PARA) .\" This program is free software; you can redistribute it and/or @@ -53,9 +54,12 @@ The default is 0. .B threads .I number .RS -This is the number of threads that are started to wait for +This is the initial number of threads that are started to wait for requests. At least five threads will always be created. +The number of threads may increase dynamically up to +.B max\-threads +in response to demand from clients, but never decreases. .RE .PP .B max\-threads @@ -83,9 +87,20 @@ Specifies the user who is allowed to request statistics. unlimited | .I number .RS -Limit on the number of times a cached entry gets reloaded without being used +Sets a limit on the number of times a cached entry +gets reloaded without being used before it gets removed. -The default is 5. +The limit can take values ranging from 0 to 254; +values 255 or higher behave the same as +.BR unlimited . +Limit values can be specified in either decimal +or hexadecimal with a "0x" prefix. +The special value +.B unlimited +is case-insensitive. +The default limit is 5. +A limit of 0 turns off the reloading feature. +See NOTES below for further discussion of reloading. .RE .PP .B paranoia @@ -128,6 +143,9 @@ in the specified cache for is in seconds. Larger values increase cache hit rates and reduce mean response times, but increase problems with cache coherence. +Note that for some name services (including specifically DNS) +the TTL returned from the name service is used and +this attribute is ignored. .RE .PP .B negative\-time\-to\-live @@ -166,6 +184,7 @@ The files are .IR /etc/passwd , .IR /etc/group , .IR /etc/hosts , +.IR /etc/resolv.conf , .IR /etc/services , and .IR /etc/netgroup . @@ -194,6 +213,8 @@ is shared with the clients so that they can directly search in them instead of having to ask the daemon over the socket each time a lookup is performed. The default is no. +Note that a cache miss will still result in +asking the daemon over the socket. .RE .PP .B max\-db\-size @@ -236,6 +257,91 @@ from the source code of and are used if not overridden in the configuration file. The default values used in the configuration file of your distribution might differ. +.SS Reloading +.BR nscd (8) +has a feature called reloading whose behavior can be surprising. +.PP +Reloading is enabled when the +.B reload-count +attribute has a non-zero value. +The default value in the source code enables reloading, +although your distribution may differ. +.PP +When reloading is enabled, +positive cached entries (the results of successful queries) +do not simply expire when their TTL is up. +Instead, at the expiry time +.B nscd +will "reload", +i.e., re-issue to the name service the same query that created the cached entry, +to get a new value to cache. +Depending on +.I /etc/nsswitch.conf +this may mean that a DNS, LDAP, or NIS request is made. +If the new query is successful, +reloading will repeat when the new value would expire, +until +.B reload-count +reloads have happened for the entry, +and only then will it actually be removed from the cache. +A request from a client which hits the entry will reset the +reload counter on the entry. +Purging the cache using +.I nscd\~-i +overrides the reload logic and removes the entry. +.PP +Reloading has the effect of extending cache entry TTLs without +compromising on cache coherency, +at the cost of additional load on the backing name service. +Whether this is a good idea on your system depends on +details of your applications' behavior, +your name service, +and the effective TTL values of your cache entries. +Note that for some name services +(for example, DNS), +the effective TTL is the value returned from the name service and +.I not +the value of the +.B positive\-time\-to\-live +attribute. +.PP +Please consider the following advice carefully: +.IP \(bu +If your application will make a second request for the same name, +after more then 1 TTL but before +.B reload\-count +TTLs, +and is sensitive to the latency of a cache miss, +then reloading may be a good idea for you. +.IP \(bu +If your name service is configured to return very short TTLs, +and your applications only make requests rarely under normal circumstances, +then reloading may result in additional load on your backing name service +without any benefit to applications, +which is probably a bad idea for you. +.IP \(bu +If your name service capacity is limited, +reloading may have the surprising effect of +increasing load on your name service instead of reducing it, +and may be a bad idea for you. +.IP \(bu +Setting +.B reload\-count +to +.B unlimited +is almost never a good idea, +as it will result in a cache that never expires entries and puts never-ending +additional load on the backing name service. +.PP +Some distributions have an init script for +.BR nscd (8) +with a +.I reload +command which uses +.I nscd\~-i +to purge the cache. +That use of the word "reload" is entirely different +from the "reloading" described here. .SH SEE ALSO .BR nscd (8) .\" .SH AUTHOR