From owner-freebsd-stable@freebsd.org Thu Oct 20 13:54:42 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 56617C19F1D for ; Thu, 20 Oct 2016 13:54:42 +0000 (UTC) (envelope-from nicolas.gilles@gmail.com) Received: from mail-lf0-x233.google.com (mail-lf0-x233.google.com [IPv6:2a00:1450:4010:c07::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D30BDAFF for ; Thu, 20 Oct 2016 13:54:41 +0000 (UTC) (envelope-from nicolas.gilles@gmail.com) Received: by mail-lf0-x233.google.com with SMTP id b75so83089712lfg.3 for ; Thu, 20 Oct 2016 06:54:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=yE2qyBgvTlzY8BqDKgz2v6pbJxu9X8fot3pd//qm0RE=; b=dod05uDh84+9zNj7Pf0eUpK73l/CioFibVgT2q6BHIKy21xEtzF0/zKAf5ZU8sxin4 9es4eAvhJFD4j/yV70Q9xPAFZZQsPTcXAsFfy35TkugHc8R7pJqJC7wxHl6ruQ2aXO8i kxbKOSbKs/3Spxbkx9GBE8+KHFP9J5WUmQA5aXSc3Cz4zyCHgiLeY4AToQA8c2UrBnAO TDhZcHoWrzCD+wYczDTev2707kWk/6Dv+KYeoDuxP1i4DIo3UkYXo3RMtXOhq5KKeFk5 vaB8zczX93UhyJZPoKbgFOuBF3Vdsh6hocfMcCva15tOgR63qt16RBvrX1dl1ewgM8wu 7DUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=yE2qyBgvTlzY8BqDKgz2v6pbJxu9X8fot3pd//qm0RE=; b=Y4eTkms3I/l8J6Y+x64RcTr1Kqc3HUmKNwiU5wtmj/8r4Z4IepRvexHmXEgyCeLEcQ HV9nTTffblX5m1h+HRoL+NxVK/SDsYSX8pKPdG6iHBfCiqd8SeKR1jmS1Chw3eRqFBYP +b9/3pyLp8jlsqd+hvz5BcFUWJgDMgSc9JmG1FaWc1XjY7J0N99qDkGm7pEJ+UTh7OxS H5IoW6gB1uLJU+5v/L+HGNuG5mo9aQfud0mCBJz0eSlEdfxP3tyrXn5Vk/XTESEfWvbi 52eTxJyt3ui0YPtiweDxpNzCI5HELfOivv8QfFQ8nEkqUQrukw/teEY/XklX4s1TVH3H jCBg== X-Gm-Message-State: AA6/9RkVO3A8ksyd7RzpcinR53ASv8ZKNT4hu2J9OtOk06jKbF7vWl3uC0ivqH83DRSUFzCnfIveYljnd/WJmQ== X-Received: by 10.25.190.71 with SMTP id o68mr1827895lff.23.1476971679577; Thu, 20 Oct 2016 06:54:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.25.195.147 with HTTP; Thu, 20 Oct 2016 06:54:38 -0700 (PDT) In-Reply-To: <4d9269af-ed64-bb73-eb7f-98a3f5ffd5a2@norma.perm.ru> References: <4d9269af-ed64-bb73-eb7f-98a3f5ffd5a2@norma.perm.ru> From: Nicolas Gilles Date: Thu, 20 Oct 2016 15:54:38 +0200 Message-ID: Subject: Re: zfs, a directory that used to hold lot of files and listing pause To: "Eugene M. Zheganin" Cc: freebsd-stable@freebsd.org Content-Type: text/plain; charset=UTF-8 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:54:42 -0000 On Thu, Oct 20, 2016 at 3:47 PM, Eugene M. Zheganin wrote: > 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 Looks like it's not taking up any processing time, so my guess is the lag probably comes from stalled I/O ... bad disk? Does a second "ls" immediately returned (ie. metadata has been cached) ? > > ===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. > > _______________________________________________ > freebsd-stable@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-stable > To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org"