From owner-freebsd-stable@FreeBSD.ORG Wed Apr 27 18:14:18 2005 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 09CBB16A4CE for ; Wed, 27 Apr 2005 18:14:18 +0000 (GMT) Received: from mail-gw1.york.ac.uk (mail-gw1.york.ac.uk [144.32.128.246]) by mx1.FreeBSD.org (Postfix) with ESMTP id E0F3C43D45 for ; Wed, 27 Apr 2005 18:14:16 +0000 (GMT) (envelope-from gavin.atkinson@ury.york.ac.uk) Received: from buffy.york.ac.uk (buffy-128.york.ac.uk [144.32.128.165]) by mail-gw1.york.ac.uk (8.12.10/8.12.10) with ESMTP id j3RIDtLM022788; Wed, 27 Apr 2005 19:13:55 +0100 (BST) Received: from buffy.york.ac.uk (localhost [127.0.0.1]) by buffy.york.ac.uk (8.13.3/8.13.1) with ESMTP id j3RIDtTP024468; Wed, 27 Apr 2005 19:13:55 +0100 (BST) (envelope-from gavin.atkinson@ury.york.ac.uk) Received: (from ga9@localhost) by buffy.york.ac.uk (8.13.3/8.13.1/Submit) id j3RIDsWN024467; Wed, 27 Apr 2005 19:13:54 +0100 (BST) (envelope-from gavin.atkinson@ury.york.ac.uk) X-Authentication-Warning: buffy.york.ac.uk: ga9 set sender to gavin.atkinson@ury.york.ac.uk using -f From: Gavin Atkinson To: Oliver Brandmueller In-Reply-To: <20050425105919.GA95908@e-Gitt.NET> References: <20050425105919.GA95908@e-Gitt.NET> Content-Type: multipart/mixed; boundary="=-WnKkZdAEcQaOG0EkddGZ" Date: Wed, 27 Apr 2005 19:13:52 +0100 Message-Id: <1114625632.21968.34.camel@buffy.york.ac.uk> Mime-Version: 1.0 X-Mailer: Evolution 2.2.1.1 FreeBSD GNOME Team Port X-York-MailScanner: Found to be clean X-York-MailScanner-From: gavin.atkinson@ury.york.ac.uk cc: freebsd-stable@freebsd.org Subject: Re: nss_ldap / top startup X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2005 18:14:18 -0000 --=-WnKkZdAEcQaOG0EkddGZ Content-Type: text/plain Content-Transfer-Encoding: 7bit On Mon, 2005-04-25 at 12:59 +0200, Oliver Brandmueller wrote: > Hi, > > I have some servers running running on 5.4-STABLE as of Apr 5th. I use > nss_ldap for a userbase of currently about 24000 accounts (will be > growing to approx 60000 in the next weeks). I don't use pam_ldap > currently, because users only need to login by IMAP, POP, SMTP and FTP, > for all of these services daemons are used which natively auth against > the LDAP server. > > The more accounts there are in the LDAP directory, the longer the > startup of "top" takes. With the current userbase top takes about 3-4 > seconds to start (on a mostly idle Dual Xeon 2.8GHz with fast disks and > local slapd). FWIW, I don't think this is related to LDAP as such. I have a machine bound to NIS with ~19000 entries in the passwd file. Top takes ages to start up. The problem is in machine.c - it iterates over every user in the passwd file to figure out what how many characters longest username may be. It's nasty and to be honest I think it can/should just be removed. Try the attached patch just to prove that this is the cause in your case too. A while back, there was talk of a FreeBSD libc name cache daemon, but I can't seem to find any reference to it now (I seem to remember the website was within .ru, if it helps anyone find it) - though I'm not sure it would help in this context or even if it's really the correct way to mask the bug. Gavin --=-WnKkZdAEcQaOG0EkddGZ Content-Disposition: attachment; filename=top-machine.diff Content-Type: text/x-patch; name=top-machine.diff; charset=us-ascii Content-Transfer-Encoding: base64 SW5kZXg6IHNyYy91c3IuYmluL3RvcC9tYWNoaW5lLmMNCj09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NClJDUyBmaWxlOiAv dXNyL2N2cy9zcmMvdXNyLmJpbi90b3AvbWFjaGluZS5jLHYNCnJldHJpZXZpbmcgcmV2aXNpb24g MS42OA0KZGlmZiAtdSAtcjEuNjggbWFjaGluZS5jDQotLS0gc3JjL3Vzci5iaW4vdG9wL21hY2hp bmUuYwkxNiBBdWcgMjAwNCAwNzo1MToyMiAtMDAwMAkxLjY4DQorKysgc3JjL3Vzci5iaW4vdG9w L21hY2hpbmUuYwkyNyBBcHIgMjAwNSAxODowMzowOSAtMDAwMA0KQEAgLTIyOCwxMCArMjI4LDEz IEBADQogCSAgICBtb2RlbGVuICE9IHNpemVvZihzbXBtb2RlKSkNCiAJCXNtcG1vZGUgPSAwOw0K IA0KKyNpZiAwDQogCXdoaWxlICgocHcgPSBnZXRwd2VudCgpKSAhPSBOVUxMKSB7DQogCQlpZiAo c3RybGVuKHB3LT5wd19uYW1lKSA+IG5hbWVsZW5ndGgpDQogCQkJbmFtZWxlbmd0aCA9IHN0cmxl bihwdy0+cHdfbmFtZSk7DQogCX0NCisjZW5kaWYNCisJbmFtZWxlbmd0aCA9IDg7DQogCWlmIChu YW1lbGVuZ3RoIDwgOCkNCiAJCW5hbWVsZW5ndGggPSA4Ow0KIAlpZiAoc21wbW9kZSAmJiBuYW1l bGVuZ3RoID4gMTMpDQo= --=-WnKkZdAEcQaOG0EkddGZ--