From patchwork Fri Aug 6 16:41:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Banks X-Patchwork-Id: 44597 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 3E4A039A24A7 for ; Fri, 6 Aug 2021 16:42:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3E4A039A24A7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1628268136; bh=/ZdXwvVR+hVTSWX/oxJNXDDa961UxdvnE092+EjMopk=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=sh1zlkUqQiX8O4IhxkLngBmUwd2bkgBTm3LQBLTl5ytCSvwQTHPevmhEwvcGFZkYj k/6JfQ2YiCwMyW7L0s6upsBVbboIRAPkP9rfiQ6cYiESo5QlN69W16yKb2L+p5oOa4 ZQYhxfF/B5VGNPxTW43oUoYtHliQx5XHay54pfTo= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail523.linkedin.com (mail523.linkedin.com [IPv6:2620:109:c003:104::123]) by sourceware.org (Postfix) with ESMTPS id 4B060385741A for ; Fri, 6 Aug 2021 16:41:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4B060385741A Received: from [2a01:111:f400:7eaa::207] ([2a01:111:f400:7eaa::207.33923] 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 B2/3F-26186-E466D016; Fri, 06 Aug 2021 16:41:50 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PT0cmOxQipiBFOy/SjMRZkoaynoQ9qiv294AiGm+KY0MMGEeRmJJXm0J4P/MzU+mUCQJipFLArGr6F2fqM/aCyPRbR6E7DqoRuhW99Extp85ga0LQ4r1StQm3XuwCmVTGxgss39uJfcP8fVCxtL03TFuajuUeYfuIqE2wAa/ZSUOp+HlXFwrJYKUOwJmhjHPZah3YRSBaOjPTi/b6u/NY3N01fAxVfgAc+oAc2AFkmDKEEQfHvPj9fNVxiQF1Vf+kdrMdcfQ1AWenRwa0cX3Q6lFsqh02IoB0wEh560+y/P59v4pZUgaOaxTi9+A8q5KAXwgDCoeqDpX/7b4qmxM/A== 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=/ZdXwvVR+hVTSWX/oxJNXDDa961UxdvnE092+EjMopk=; b=SHmCo7tKg2snvwhlwqBr5HrqtpdJ6vBvr8L9DA9OzKaXKWRwtpVBhZElU16FN5iozKj7z6pLIbFwvAQYjrtwyH0kfH9PY83tAU7XD7czBXl8f2hrXjMVone188Y1IolCC8Rfg4nLzwzORo63hS7uBzs8U4A46ecTR5gRVOf/MSj5eBfy8wSPGT5gKiA3IOBmplbCL+QzcUouSdBb4vtAiznXUAexw6RWrj0P7VRRPuVwWEBMjeV4PVHJO7CZoDJ746zhgNCgbCkiKXhIIm4Brgs/w45tVYW64+zbIX4R8bZWmVIrT9TYT4nfLmAlni8QI3s+xtjda8MiJUdIGbc2Gg== 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 BL0PR2101MB1041.namprd21.prod.outlook.com (2603:10b6:207:36::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.1; Fri, 6 Aug 2021 16:41:38 +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.009; Fri, 6 Aug 2021 16:41:38 +0000 To: "Alejandro Colomar (man-pages)" Subject: [patch] nscd.conf.5: describe reloading, clarifications, v5 Thread-Topic: [patch] nscd.conf.5: describe reloading, clarifications, v5 Thread-Index: AQHXiuG/mtX29mJjH0qJXrFoIv0EMQ== Date: Fri, 6 Aug 2021 16:41:38 +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-06T16:41:38.061Z; 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: ffc8748b-f343-4f6f-c6ef-08d958f90fea x-ms-traffictypediagnostic: BL0PR2101MB1041: 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: FSNmCTNvY0ZIUmRNmK2vbZe+AWdcaczmkcMQAlkmah3KJhjnJpehk1rRhmg6kf6jk5mm3ABJAkHIaNYiChfRppAKGQag00Sn1DWpmmGpsYEztu2rOwzVRgod/PzDH70t1p59c2oV7TfxQy2Xm744RZl8yLAAepxsv0HTHEJOJn3YXccguYZe7erFX3xLYpY+LIMCGkyOoNZKTAqsj3iMJ0OuovWgspRRX7s4MBVW40fQBKtqTFlVc0R2BzHaMrdvBhyZWdskP7XZb+HK/GFlXgrQXdXKyRtfi2RWu7OYLPAp6ffyvNkixSFWfeCvLGZG7KQq9DCu0o8BOeU1jSaNSkpNUCNhcIH2V6DUuxRhsMZa55UcZ0WyZy9rq8E74TdTwLkB83+ThzsaJz+sFQrU6h3cu8Mhd36WEtRHGuDdvceDLFwvuov59qq0LifCgXxjsg0wLEJJE5xCOLdln+h3dD8e92FApN1gnURzrchTVOIuPiay6xwLiKjN5LxI53LDzh0E7L69mnbYXuigC4Oy+Uz0Gw7Gf03NM2bFHEUQhxQx/Flv5/pBBQb7/uPg4tf9sPTFf5MF4L9HoRRlOoMzF7cqT2QFATHIrdGqFhPXGGgWi3vdQziCH6xLB/cX80+NXks+i5PNhztz9Kq3wUG782mBlkKf+DOv9/byPbuRO89KhoarYg/gLXatgbQT46xhRrpnJmcbgpYxHDCPSvF1FfteS4/6Bj2L+IfqDx1klQDOeSNA5zb/fOlIM28IW4hS 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)(71200400001)(6916009)(2906002)(52536014)(54906003)(82950400001)(9686003)(83380400001)(122000001)(66556008)(66946007)(33656002)(66446008)(76116006)(66476007)(38100700002)(82960400001)(86362001)(64756008)(5660300002)(186003)(4326008)(8936002)(26005)(7696005)(316002)(8676002)(8990500004)(38070700005)(508600001)(55016002)(6506007)(2004002)(134885004); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1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GWCuPY7gc35ApN3?= =?iso-8859-1?q?KltBvkGaCAFq8IPIdqaykAQxIWAzSTXqUEeTwwC+o3EjE0fqqSD8tAFdxGNO?= =?iso-8859-1?q?lVAk2947X975ZEIx9rIE5L+1tlakTSzoeG1fMK4HKJZFKBxmY9t2Jyy8upBz?= =?iso-8859-1?q?VpNqWnLO/AtSjW4f10x3qvaJUSngjW8lq0CDH/I2ma6VGBeDidNj5Z5Gv2Uu?= =?iso-8859-1?q?QGyJRRVqE1NqmFOQKtE8jSDaTQimHxSJrvVXlbGN8XvV03ysb7b+F3VNHYQk?= =?iso-8859-1?q?JZ1LDhQYV/wSeBACDWBJrVYSE3SKJ0wT19NX1jueTtLgehmpd4o3Hv60WEhQ?= =?iso-8859-1?q?Uy17Qx6EqakELLJ+vC9tOkPCckYJftxs2C1oO6l1W5az8Cdyicf5rU5RyRoX?= =?iso-8859-1?q?/JnVyVxeLT7+vorFpVG0V28im3SFMJiFuZywL7fKqU1wRVVvrzhXhpDyjhob?= =?iso-8859-1?q?zT3iIeDAFG8qwo0IDFhOi0OanUL8k7I05nBl1pOg=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: ffc8748b-f343-4f6f-c6ef-08d958f90fea X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Aug 2021 16:41:38.5845 (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: 1Uo/3Bu0PH3QZdOaU0uZONUAnwp/cxKZqfEc3iVgcgghSaYdc2Ry+I0r7UCZb3MU0prbuXJiZDHHLM/uQ6gVNQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR2101MB1041 X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, LINKEDIN_RECEIVED, 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.v5 for you to fetch changes up to de00b682c0d2280c92c692fbcdb6cf5d4ca9bc01: nscd.conf.5: describe reloading, clarifications, v5 (2021-08-06 09:26:57 -0700) ---------------------------------------------------------------- Greg Banks (1): nscd.conf.5: describe reloading, clarifications, v5 man5/nscd.conf.5 | 115 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 112 insertions(+), 3 deletions(-) diff --git a/man5/nscd.conf.5 b/man5/nscd.conf.5 index 7356bf7c2..25ee4901b 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,13 @@ 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 +88,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 +144,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 +185,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 +214,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 +258,93 @@ 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 than 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