From owner-freebsd-arm@freebsd.org Thu Jun 9 09:38:16 2016 Return-Path: Delivered-To: freebsd-arm@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 97CB8AEE716 for ; Thu, 9 Jun 2016 09:38:16 +0000 (UTC) (envelope-from imrehg@gmail.com) Received: from mail-wm0-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c:c09::22d]) (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 26C891A15 for ; Thu, 9 Jun 2016 09:38:16 +0000 (UTC) (envelope-from imrehg@gmail.com) Received: by mail-wm0-x22d.google.com with SMTP id n184so216714375wmn.1 for ; Thu, 09 Jun 2016 02:38:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=lvrEFM/i58FWTIsYRAp/mMnYg9DUg1IPIQD26I0Ji3Q=; b=ZoJzJSM3nyBMWdWBwjwAoEzNnlb1BMjdDWZKqVhwbmGHq2isJfsxk+9AyVOcffzyvw 5a3VF62S1B4HKhwFjanYVKz6Ksb7eVbdx6vt/nUZg5xCd8FXwXr227UNeSG7QhGyYnes 7BQeWF+iYikl6ApQ37oi9t2wJJBZva8i4fu4vAX2b8qD9HTXPG+nqxtJtaFRd4MAx8MW GCbBJtmmlI15P6PfA7mnechGFXhQo71FbeA5kkI7WbFE1Mxu+bGHllM0v6VneCSfFCOr yLS+kCHXiQzsd/t5+hM77KPIu27JFf5zJ1J5QPgGdK9/D2zpE05/xPvUn6vSmfsatV6u 9olw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=lvrEFM/i58FWTIsYRAp/mMnYg9DUg1IPIQD26I0Ji3Q=; b=DrzMUr/ZSyifmoYHEYTwM7/E1AEzNLEKRR46Cxwwq0vS1bReHKCIcspsGSfk9tK5hm nXttRSWO7lsPamuqRUtoPDTMSGaR7BidUtiaWLIo5w/lR9tNfyDEKw0o/U8eSZiIrXjc 7bd7dF491pidFl40e5NKmYhaCe0w2jDm413E1fFOtCU97V3FQdPsXvAH4ZFOjwZ1gg5h vNqlGEJrv1vWQqh+yN5nRLZtJjmavFoGLQElBfthSNjV5xWpeQq+f+N2gQ+UdYmjMp2W st+adWjXOrgodjQqbOOvbUXqQ/qhvTheGYVWySn79qZZaj0LpeSH2/lartJbNOOQOhDX IVnA== X-Gm-Message-State: ALyK8tINR3jeYS6jW8PcdQrjYxvq57aKSHskjbfYUjLbmCYuLuKpE5J3K2HPS+nMRkA4H9UQm2DilsuOmdmPcg== X-Received: by 10.194.79.69 with SMTP id h5mr9454709wjx.129.1465465094564; Thu, 09 Jun 2016 02:38:14 -0700 (PDT) MIME-Version: 1.0 Received: by 10.194.106.165 with HTTP; Thu, 9 Jun 2016 02:37:54 -0700 (PDT) From: Gergely Imreh Date: Thu, 9 Jun 2016 17:37:54 +0800 Message-ID: Subject: RPi2 i/o blocking and SD card performance To: FreeBSD ARM Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 09:38:16 -0000 Hi, I've been testing FreeBSD 11.0-CURRENT on a RaspberryPi2. I'm relatively new to FreeBSD, and wondering if there's any advice for improving the performance a bit. First, it looks like there's a lot of i/o blocking behaviour going on. For example running MediaWiki on the board, if I compile any ports, the site itself is pretty much unusable (the PHP scripts time out even with 180s timeouts). The strangest thing is that the CPU usage is not at 100% all the way, can be that all 4 cores are ~99% idle, and still everything goes very slow. Once the ports compilation or any other i/o-related task is finished, it's snappy again. Any idea why it could be to have such big latency/lag even though the CPU is idle? Is there anything I could test? Second, I've also tried profiling the SD card a bit. The very same card (SanDisk 32GB), same RPi board once with a fresh install of FreeBSD and once with a fresh install of ArchLinuxARM, running bonnie++ -s 2000 (the results below) The block write perfomance on ArchLinux is ~55% higher (14M/s vs 9M/s), while rewrite and per char output is 4-5x larger. Block read is also ~70% larger (25M/s vs 15M/s). This is without any tuning. Any idea why the FreeBSD performance on the exact same hardware is so different, and whether it can be improved? I guess these two questions are related. FreeBSD: version 1.97 ------Sequential Output------ --Sequential Input- --Random- Concurrency 1 -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks-- Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP rpi2 2000M 20 99 8924 14 2275 4 39 99 14873 14 33.9 4 Latency 481ms 4407ms 8319ms 244ms 153ms 226s Version 1.97 ------Sequential Create------ --------Random Create-------- rpi2 -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete-- files /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP 16 660 25 10388 100 3483 99 1532 58 10702 99 3531 99 Latency 2769ms 375us 754us 1967ms 253us 512us ArchLinux: Version 1.97 ------Sequential Output------ --Sequential Input- --Random- Concurrency 1 -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks-- Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP alarmpi 2000M 102 99 13901 10 8089 7 579 99 25264 8 30.6 1 Latency 115ms 5843ms 6381ms 22745us 54383us 40338ms Version 1.97 ------Sequential Create------ --------Random Create-------- alarmpi -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete-- files /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP 16 4460 38 +++++ +++ 6002 34 4137 34 +++++ +++ 7440 43 Latency 1391us 3885us 3757us 1068us 113us 1261us Cheers, Greg