Date: Mon, 21 May 2007 13:20:04 +0400 From: Anton Yuzhaninov <citrin@citrin.ru> To: Edwin Groothuis <edwin@mavetju.org> Cc: freebsd-net@freebsd.org Subject: Re: faster /etc/services Message-ID: <1607720081.20070521132004@citrin.ru> In-Reply-To: <20070521070938.GA48283@k7.mavetju> References: <20070521070938.GA48283@k7.mavetju>
next in thread | previous in thread | raw e-mail | index | archive | help
Monday, May 21, 2007, 11:09:38 AM, Edwin Groothuis wrote: EG> - Instead of reading and parsing /etc/services every time, use a EG> hash or btree file a la the aliases database. A hash one (first EG> key, next key) could be a replacement to use with getservent(), EG> while a btree one could be be a replacement to use with getservbyname(). EG> This doesn't have the startup-penalty, but the sysadmin needs to EG> keep track of changes in /etc/services and needs to rebuild it. I think it will be better solution. /etc/services edited by sysadmin rarely and we can place comments in this file about hash. EG> - Instead of reading and parsing /etc/services every time, open a EG> socket and ask a daemon for the information. Which daemon is a EG> good question, but it can automatically re-read the /etc/services EG> file if it got changed. Connection to external daemon is additional overhead. Anyway, is there need to optimize getservbyname()? Is there any applications, which call getservbyname() on each connection/request? IMHO /etc/services can be kept in current state. -- WBR, Anton Yuzhaninov
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1607720081.20070521132004>