From owner-freebsd-performance@FreeBSD.ORG Sun Apr 15 20:17:16 2012 Return-Path: Delivered-To: freebsd-performance@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 66B35106566B; Sun, 15 Apr 2012 20:17:16 +0000 (UTC) (envelope-from ohartman@zedat.fu-berlin.de) Received: from outpost1.zedat.fu-berlin.de (outpost1.zedat.fu-berlin.de [130.133.4.66]) by mx1.freebsd.org (Postfix) with ESMTP id 05A238FC0C; Sun, 15 Apr 2012 20:17:16 +0000 (UTC) Received: from inpost2.zedat.fu-berlin.de ([130.133.4.69]) by outpost1.zedat.fu-berlin.de (Exim 4.69) with esmtp (envelope-from ) id <1SJVso-000749-V3>; Sun, 15 Apr 2012 22:17:15 +0200 Received: from e178030137.adsl.alicedsl.de ([85.178.30.137] helo=thor.walstatt.dyndns.org) by inpost2.zedat.fu-berlin.de (Exim 4.69) with esmtpsa (envelope-from ) id <1SJVso-0004Jy-O1>; Sun, 15 Apr 2012 22:17:14 +0200 Message-ID: <4F8B2CC4.5030601@zedat.fu-berlin.de> Date: Sun, 15 Apr 2012 22:17:08 +0200 From: "O. Hartmann" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:10.0.3) Gecko/20120314 Thunderbird/10.0.3 MIME-Version: 1.0 To: Garrett Cooper References: <4F8AAEF7.3090800@zedat.fu-berlin.de> <4F8B21D2.4080008@zedat.fu-berlin.de> <951B1A8C-A216-420A-BA17-316B8D9C2B0E@gmail.com> In-Reply-To: <951B1A8C-A216-420A-BA17-316B8D9C2B0E@gmail.com> X-Enigmail-Version: 1.4 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig8F6C5458A718E52245A69775" X-Originating-IP: 85.178.30.137 Cc: freebsd-security@freebsd.org, Richard Kojedzinszky , Current FreeBSD , freebsd-performance@freebsd.org Subject: Re: ufs multilabel performance (fwd) X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Apr 2012 20:17:16 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig8F6C5458A718E52245A69775 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Am 04/15/12 22:00, schrieb Garrett Cooper: > On Apr 15, 2012, at 12:30 PM, O. Hartmann wrote: >=20 >> Am 04/15/12 15:59, schrieb Richard Kojedzinszky: >>> Thank you for the reply. >>> >>> Unfortunately, dont know why, but on my xen virtualised environment, >>> fbsd amd64 domU performs much slower, not only 30 times. Without >>> multilabel, file creation speed is around 2500/s, but with multilabel= s >>> enabled, it is only 15/s (!). so it is more than 100 times slower. >>> >>> And anyway freebsd is known to be fast as well, as functional. The po= wer >>> to serve. :) >>> >>> But in my environment, 15/s file creation is very-very slow. The >>> hardware is a q6700 cpu with 4G ram, 2x1T sata disks in raid1, the ho= st >>> runs linux. I think with this hw the mentioned speed is really slow. >>> >>> Regards, >>> >>> >>> Kojedzinszky Richard >>> Euronet Magyarorszag Informatikai Zrt. >>> >>> On Sun, 15 Apr 2012, O. Hartmann wrote: >>> >>>> Date: Sun, 15 Apr 2012 13:20:23 +0200 >>>> From: O. Hartmann >>>> To: Richard Kojedzinszky >>>> Cc: freebsd-security@freebsd.org >>>> Subject: Re: ufs multilabel performance (fwd) >>>> >>>> Am 04/14/12 21:37, schrieb Richard Kojedzinszky: >>>>> Dear list, >>>>> >>>>> Although it is not only security-related question, I did not get an= y >>>>> answer from freebsd-performance. The original question is below. >>>>> >>>>> Can someone give some advice? >>>>> >>>>> Thanks in advance, >>>>> >>>>> >>>>> Kojedzinszky Richard >>>>> Euronet Magyarorszag Informatikai Zrt. >>>>> >>>>> ---------- Forwarded message ---------- >>>>> Date: Thu, 10 Nov 2011 06:16:57 +0100 (CET) >>>>> From: Richard Kojedzinszky >>>>> To: freebsd-performance@freebsd.org >>>>> Subject: ufs multilabel performance >>>>> >>>>> Dear List, >>>>> >>>>> I've noticed that when I enable multilabel on an fs, a file creatio= n >>>>> gets around 20-30 times slower than without multilabel set. >>>>> >>>>> This one-liner can be used to test the differences: >>>>> $ truss -D perl -e 'open(F, ">$_.file") for 1 .. 1000' >>>> >>>> Same here, creating files seems to be 10 - 30 times slower with >>>> multilabels as it is without. >>>> >>>> But as several posts and discussions reflects, FreeBSD isn't suppose= d to >>>> be fast although it is claimed that writing is the major than readin= g; >>>> FBSD should serve functionality. >>>>> >>>>> And one can see that the open call takes much more when multilabel = is >>>>> set on an fs. It seems that only file creation needs that many time= , >>>>> when a file exists it is opened much faster. >>>>> >>>>> Could someone acknowledge this, and have some suggestions how to ma= ke it >>>>> faster? >>>>> >>>>> Regards, >>>>> >>>>> >>>>> Kojedzinszky Richard >>>>> TvNetWork Nyrt. >>>>> E-mail: krichy (at) tvnetwork [dot] hu >>>>> PGP: 0x54B2BF0C8F59B1B7 >>>>> Fingerprint =3D F6D4 3FFE AF03 CACF 0DCB 46A1 54B2 BF0C 8F59 B1B7= >> >> At the moment, I'm troubled with a nasty kernel bug on all FreeBSD 10 >> boxes I have spare to test. >> >> I just tried to reproduce your observation and as far as I can go with= >> my experience, I can confirm that by using your perl script. >> >> I'd like to test this again with a small C program. >> >> I can only test the issue (test is too far optimistic, it's simply a >> reproduction of your observation) on FreeBSD 10, the only remaining >> FreeBSD server at our department is running FBSD 9-STABLE/amd64 and "i= n >> production", so changing multilabel support is a bit harsh at the mome= nt. >> >> >> Sorry about crossposting, but I think this belongs more to CURRENT and= >> PERFORMANCE than SECURITY. >=20 > My suggestion is completely take perl out of the equation because the w= ay you're invoking it above uses stdio and a few other things that add un= necessary overhead. >=20 > Try the attached C program/bourne shell snippet instead. >=20 > Cheers, > -Garrett >=20 > #!/bin/sh >=20 > set -e >=20 > tmp=3D$(mktemp -d tmp.XXXXXX) > trap "cd /; rm -Rf $tmp" EXIT > cd $tmp >=20 > cat > test_open.c <=20 > #include > #include > #include >=20 > int > main(void) > { > char buf[20]; > int i; >=20 > for (i =3D 0; i < 1000; i++) { > sprintf(buf, "%d", i); > close(open(buf, O_WRONLY|O_CREAT, 0600)); > } > return (0); > } > EOF >=20 > gcc -o test_open test_open.c > time ./test_open_______________________________________________ This was pretty fast ;-) --------------enig8F6C5458A718E52245A69775 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQEcBAEBAgAGBQJPiyzJAAoJEOgBcD7A/5N88K4IAM1Ta4DbIuYJHdbJ7TYYqPCF cfM24slE0SikRQLxpNAtcm2gnVELhwxDiKbkFuM3277pmL9gpWhoLvJoLuCcNEo3 UKsr6YHzxfIPgcv61JhRzhyki0ETdjKbZorMpfhQAGfI1ssQQ824mMMTvWfMSOu2 x6wJ+d0pPZGlWRRkfhVUYZBaqdfj/OuM7pIq+COAU12UhZySt+4srryMeDJDzQNU Dv7ile+FrXCQ8yrqy9nbeyRJJlPpDqnb7eQS/7d78hlnzL8tFXT6XaxOZGvB3NM2 Ej2pmGqvju+TvO9LI/CemsnEJByHmJNkFWiOTMpyrHhoCgIqr8NB7SzH98Vt5j8= =j3k7 -----END PGP SIGNATURE----- --------------enig8F6C5458A718E52245A69775--