From owner-freebsd-questions@FreeBSD.ORG Mon Sep 12 03:43:11 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5E2FE16A41F for ; Mon, 12 Sep 2005 03:43:11 +0000 (GMT) (envelope-from nikolai@net24.co.nz) Received: from netmon.net24.net.nz (netmon.net24.net.nz [210.55.4.6]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7A0DF43D48 for ; Mon, 12 Sep 2005 03:43:09 +0000 (GMT) (envelope-from nikolai@net24.co.nz) Received: from [210.55.30.50] ([210.55.30.50]) by netmon.net24.net.nz (8.11.6/8.11.6) with ESMTP id j8C3h4K56927 for ; Mon, 12 Sep 2005 15:43:05 +1200 (NZST) (envelope-from nikolai@net24.co.nz) Message-ID: <4324F94A.6090005@net24.co.nz> Date: Mon, 12 Sep 2005 15:43:06 +1200 From: Nikolai Schupbach User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Long Format Directory Listing 15x Slower in FreeBSD 5.x X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Sep 2005 03:43:11 -0000 Hello, We have been trying to migrate to FreeBSD 5.4 from an older 4.x release for one of our busy mail servers. But we have encountered problems with directory listings on 5.4. Our /var/mail directory contains approximately 8,000 files doing a long directory listing (ls -l) takes approximately 5 min and during this time the CPU is running near 100%, on a FSBD 4 box the same directory contents takes less than 20 seconds to list. Even on a directory with 200 files, each file with a different owner, it will still take at least 4-5 seconds to list. The problems only seems to occur when the directory contains files from many different users. (as in /var/mail). If I chown all the files in the /var/mail directory to a single user the directory listing is near instant. It appears it has something to do with 'ls' looking up the id's in the password database, because if I instruct ls to display numeric IDs (ls -ln), rather than converting to user and group names, the directory with 8,000 files, with 8,000 different owners will list instantly. The reason this concerns me so much is we are also having a problem with our Washington IMAP / POP3 server on FBSD 5 using a lot of CPU while operating on small and even 0 byte mailboxes, when there are approx five or more concurrent POP3 or IMAP sessions. And I can't help thinking that the two problems are related. Does anyone have any ideas? Has anyone else noticed this problem? If I can't resolve it I'm most likely going to revert to using 4.11, but I'd really like to know what is going on. (and yes I'm using UFS_DIRHASH) -- Nikolai