From owner-freebsd-fs@FreeBSD.ORG Tue Mar 31 16:42:09 2015 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DD511857 for ; Tue, 31 Mar 2015 16:42:09 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 64C4BFBE for ; Tue, 31 Mar 2015 16:42:09 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t2VGg2BL004747 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Tue, 31 Mar 2015 19:42:02 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t2VGg2BL004747 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t2VGg233004746; Tue, 31 Mar 2015 19:42:02 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 31 Mar 2015 19:42:02 +0300 From: Konstantin Belousov To: Artem Kuchin Subject: Re: Little research how rm -rf and tar kill server Message-ID: <20150331164202.GN2379@kib.kiev.ua> References: <55170D9C.1070107@artem.ru> <1427727936.293597.247070269.5CE0D411@webmail.messagingengine.com> <55196FC7.8090107@artem.ru> <1427730597.303984.247097389.165D5AAB@webmail.messagingengine.com> <5519716F.6060007@artem.ru> <1427731061.306961.247099633.0A421E90@webmail.messagingengine.com> <5519740A.1070902@artem.ru> <1427731759.309823.247107417.308CD298@webmail.messagingengine.com> <5519F74C.1040308@artem.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5519F74C.1040308@artem.ru> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: freebsd-fs@freebsd.org X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Mar 2015 16:42:09 -0000 On Tue, Mar 31, 2015 at 04:24:28AM +0300, Artem Kuchin wrote: > 30.03.2015 19:09, Mark Felder пишет: > > > > On Mon, Mar 30, 2015, at 11:04, Artem Kuchin wrote: > >> 30.03.2015 18:57, Mark Felder пишет: > >>> On Mon, Mar 30, 2015, at 10:53, Artem Kuchin wrote: > >>>> This is normal state, not under rm -rf > >>>> Do you need it during rm -rf ? > >>>> > >>> No, but I wonder if changing the timer from LAPIC to HPET or possibly > >>> one of the other timers makes the system more responsive under that > >>> load. Would you mind testing that? > >>> > >>> You can switch the timer like this: > >>> > >>> sysctl kern.eventtimer.timer=HPET > >>> > >>> And then run some of your I/O tests > >>> > >> I see. I will test at night, when load goes down. > >> I cannot say sure that's a right way to dig, but i will test anything :) > >> > >> Just to remind: untar overloads the system, but untar + sync every 120s > >> does not. > >> That seems very strange to me. I think the problem might be somewhere > >> here. > >> > > I just heard from mav that there was a bottleneck in gmirror/graid with > > regards to BIO_DELETE requests > > > > https://svnweb.freebsd.org/base?view=revision&revision=280757 > > > > I applied this patch manually and rebuilt the kernel. > Hit this bug > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=195458 > on reboot, wasted 1 hour fsck-ing 2 times (was dirty after first fsck) > and after boot tried doing > rm -rf test1 > I coult not test anything, because it complete after 1 minute, instead > 15 minutes before. > I copier the dir 4 times into subdirs and rm -rf full tree (4x larger) - > fast and smooth, > mariadb did not tonice this, server were working fine. > > However, i also noticed another thing: > cp -Rp test test1 > also work a lot faster now, probably 3-5 times faster > Maybe it is because fs is free of tons BIO_DELETE from other processes > > > Then i did the untar test at maximum speed ( no pv to limit bandwidth): > i see that mysql request became slower, but mysql sql request queue > built up slower now. > However, when it reached 70 i stopped untar and mariadb could not > recover from condition > until i executed sync. However, this time sync took only a second. > I see big improvement, but i still don't understand why i need to issue > sync manually to push > everything to recover from overload. > > # man 2 sync > a sync() system call is issued frequently by the user process syncer(4) > (about every 30 seconds). > > it does not seem to be true > > I checked syncer sysctl > > # sysctl kern.filedelay > kern.filedelay: 30 > # sysctl kern.dirdelay > kern.dirdelay: 29 > # sysctl kern.metadelay > kern.metadelay: 28 > > # ps ax | grep sync > 23 - DL 0:03.82 [syncer] > > no clue why need manual sync Syncer and sync(2) perform different kind of syncs. Take the snapshot of sysctl debug.softdep before and after the situation occur to have some hints what is going on. Also, it makes sense to test the HEAD kernel after the r280763. Even if I end up with any fix, it probably would require r280760 as prerequisite. > > By the way: is there way to make sure that SU+J is really working? > Maybe it is disabled for some reason > and i don't know it. tunefs just shows stored setting, but, for example, > with dirty fs, journaling is not > working in reality. Any way to get current status of SU journaling? Your statement about 'dirty fs' makes no sense. Journaling state is displayed by mount -v.