From owner-freebsd-stable@freebsd.org Thu Oct 20 13:47:28 2016 Return-Path: Delivered-To: freebsd-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EFF1C19B9D for ; Thu, 20 Oct 2016 13:47:28 +0000 (UTC) (envelope-from emz@norma.perm.ru) Received: from elf.hq.norma.perm.ru (mail.norma.perm.ru [IPv6:2a00:7540:1::5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.norma.perm.ru", Issuer "Vivat-Trade UNIX Root CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id A4E35279 for ; Thu, 20 Oct 2016 13:47:27 +0000 (UTC) (envelope-from emz@norma.perm.ru) Received: from [IPv6:2a02:2698:27:b4d9:28e5:c182:e05b:6a1e] ([IPv6:2a02:2698:27:b4d9:28e5:c182:e05b:6a1e]) (authenticated bits=0) by elf.hq.norma.perm.ru (8.15.2/8.15.2) with ESMTPSA id u9KDlMw6019309 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Thu, 20 Oct 2016 18:47:23 +0500 (YEKT) (envelope-from emz@norma.perm.ru) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=norma.perm.ru; s=key; t=1476971243; bh=0np+EwXrxDgdAz8gVQbWAM45oc3km6QW3M1pDsD6MT0=; h=To:From:Subject:Date; b=Q7X2uyTQIeJvr/LGESKHVWCJHqnCboM2QKVpm0uwS6S3PmHg8CZKvyCz29H91xE7I E5lHsE/QTdEUcWs2Ptp5PvgeLrEhdZ4LYo5GYcR9A1e/ahjNZlyg3x4lC8LiAmW2RO DcKM/xzwQ5EiNYghUN71ShA731p670K601OFl2EI= To: freebsd-stable@FreeBSD.org From: "Eugene M. Zheganin" Subject: zfs, a directory that used to hold lot of files and listing pause Message-ID: <4d9269af-ed64-bb73-eb7f-98a3f5ffd5a2@norma.perm.ru> Date: Thu, 20 Oct 2016 18:47:28 +0500 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Oct 2016 13:47:28 -0000 Hi. I have FreeBSD 10.2-STABLE r289293 (but I have observed this situation on different releases) and a zfs. I also have one directory that used to have a lot of (tens of thousands) files. I surely takes a lot of time to get a listing of it. But now I have 2 files and a couple of dozens directories in it (I sorted files into directories). Surprisingly, there's still a lag between "ls" and an output: ===Cut=== # /usr/bin/time -h ls .recycle 2016-01 2016-04 2016-07 2016-10 sort-files.sh 2014 2016-02 2016-05 2016-08 ktrace.out sort-months.sh 2015 2016-03 2016-06 2016-09 old sounds 5.75s real 0.00s user 0.02s sys ===Cut=== I've seen this situation before, on other servers, so it's not the first time I encounter this. However, it's not 100% reproducible (I mean, if I fill the directory with dozens of thousands of files, I will not certainly get this lag after the deletion). Has anyone seen this and does anyone know how to resolve this ? It's not critical issue, but it makes thing uncomfortable here. One method I'm aware of: you can move the contents of this directory to some other place, then delete it and create again. But it's kind of a nasty workaround. Thanks. Eugene.