From owner-freebsd-current@FreeBSD.ORG Fri Apr 28 21:25:17 2006 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9154116A403 for ; Fri, 28 Apr 2006 21:25:17 +0000 (UTC) (envelope-from bushman@rsu.ru) Received: from mail.r61.net (mail.r61.net [195.208.245.249]) by mx1.FreeBSD.org (Postfix) with ESMTP id F202243D49 for ; Fri, 28 Apr 2006 21:25:16 +0000 (GMT) (envelope-from bushman@rsu.ru) Received: from jersey (p1.mp101.aaanet.ru [80.80.101.1]) (authenticated bits=0) by mail.r61.net (8.13.6/8.13.6) with ESMTP id k3SLOvA1020303 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT) for ; Sat, 29 Apr 2006 01:25:06 +0400 (MSD) (envelope-from bushman@rsu.ru) Message-ID: <002401c66b0a$44c230e0$01655050@jersey> From: "Michael Bushkov" To: Date: Sat, 29 Apr 2006 01:25:10 +0400 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="koi8-r"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Virus-Scanned: ClamAV version 0.88.1, clamav-milter version 0.88.1 on asterix.r61.net X-Virus-Status: Clean Subject: [HEADS UP] caching daemon imported into the source tree X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Apr 2006 21:25:17 -0000 Hello! I'm pleased to say that several nsswitch extensions and the caching daemon (which I've been developing during the Summer Of Code 2005 and later) are now in the source tree. Thanks very much to Brooks Davis and Jacques Vidrine, who were my mentors on this project. And very special thanks to Hajimu Umemoto, who reviewed the code and actually committed it. Extensions, which are now included into the libc and usr.sbin are: - getservXXX() functions now work through nsdispatch(). "files", "nis" and "compat" nsswitch sources are implemeted. "sources" and "sources_compat" databases can now be specified in nsswitch.conf. The idea of "services_compat" database is the same as for "passwd_compat" and "group_compat": if we find "+" in /etc/services, we'll substitute it with information received from the "services_compat" database's source. - getprotoXXX() functions now work through nsdispatch(). Only "files" source is implemented in libc. "protocols" database is now available in nsswitch.conf. - getrpcXXX() functions now work through nsdispatch(). "files" source is implemented, "rpc" database is now available. - caching daemon (cached) was implemented and caching support was added to all places, where nsdispatch() is used. - you can exclude all the caching-related stuff during the buildworld by setting MK_NS_CACHING to "no". Caching daemon is used to cache results of nsswitch queries (see cached(8) and cached.conf(5)). All you need to activate cached is: 1) Add "cached_enable=yes" to rc.conf 2) Specify "cache" source as the first source in all nsswitch databases, which queries you want to cache. By default caching daemon will cache the results of queries, made by userland. The cache will be separated by each user's euid/egid to avoid cache poisioning. There is also "perform-actual-lookups" option in cached.conf, which can make caching daemon not only to cache the results, but to perform actual query to the nsswitch sources. I.e. with perform-actual-lookups turned on for specified database, caching daemon will behave almost like nscd for this database. Currently "perform-actual-lookups" option can only be used with "passwd", "groups" and "services" databases. Caching daemon supports caching of getXXXent() functions' results (caching of sequences of data) - which can be very helpful - as getpwent() function, for example, is called during each login operation. Caching daemon can greatly increase system performance when using LDAP or NIS nsswitch sources (especially the login speed). It also helps with caching huge /etc/services file - not every getservXXX() query now searches this whole file. Performance benchmarks results comparisons still have not been made - but they will surely be done. I'm currently working further on the caching daemon and nsswitch-related stuff. Please, try it out and send me your comments and ideas. I'll be really glad to hear them. With best regards, Michael Bushkov