From owner-freebsd-questions Sun Apr 2 17:52:54 2000 Delivered-To: freebsd-questions@freebsd.org Received: from TK147108.tuwien.teleweb.at (TK147108.tuwien.teleweb.at [195.34.147.108]) by hub.freebsd.org (Postfix) with ESMTP id 51E2C37B556 for ; Sun, 2 Apr 2000 17:52:50 -0700 (PDT) (envelope-from satyr@TK147108.tuwien.teleweb.at) Received: from satyr by TK147108.tuwien.teleweb.at with local (Exim 2.12 #1) id 12bv9o-0001Kp-00 for questions@freebsd.org; Mon, 3 Apr 2000 02:55:56 +0200 Date: Mon, 3 Apr 2000 02:55:56 +0200 From: "Marinos J . Yannikos" To: questions@freebsd.org Subject: tuning the vm system / disk cache Message-ID: <20000403025556.S31173@TK147108.telekabel.at> Reply-To: nino@inode.at Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.5i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I'm trying to reduce the number of disk accesses during database queries - the database is very small, there's plenty of RAM available, and the queries are simple SELECT queries (i.e. read-only). I am using the following kernel options: maxusers 256 options SOFTUPDATES options SHMMAXPGS=65536 options SHMSEG=32 (the last 2 because I'm using postgres) The whole database takes up approx. 12MB disk space, the system looks like this: Mem: 26M Active, 13M Inact, 25M Wired, 36K Cache, 12M Buf, 438M Free Swap: 490M Total, 490M Free The filesystem used is mounted with -o async (not that it should matter - except perhaps for the logfiles, which only grow by a few 100 bytes per second anyway). Still, the disk seems to be accessed frequently during the queries: k7# iostat 5 tty ad0 acd0 fd0 cpu tin tout KB/t tps MB/s KB/t tps MB/s KB/t tps MB/s us ni sy in id 1 88 0.00 0 0.00 0.00 0 0.00 0.00 0 0.00 51 0 4 0 45 0 15 96.26 9 0.86 0.00 0 0.00 0.00 0 0.00 86 0 7 0 6 0 15 95.46 14 1.32 0.00 0 0.00 0.00 0 0.00 78 0 6 0 16 0 15 85.39 12 1.02 0.00 0 0.00 0.00 0 0.00 85 0 6 0 9 0 15 100.55 13 1.31 0.00 0 0.00 0.00 0 0.00 79 0 5 0 16 0 16 97.71 12 1.18 0.00 0 0.00 0.00 0 0.00 83 0 5 0 12 0 15 106.29 10 0.99 0.00 0 0.00 0.00 0 0.00 80 0 8 0 12 0 16 100.16 18 1.72 0.00 0 0.00 0.00 0 0.00 77 0 5 0 18 Is there any way to force a more aggressive caching by the vm system? I have looked at the sysctl variables, but my attempts at tuning them weren't very successful. Any input would be much appreciated. -mjy -- ***==> Marinos J. Yannikos ***==> http://pobox.com/~mjy To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message