From owner-freebsd-questions Sun Apr 2 19:17:22 2000 Delivered-To: freebsd-questions@freebsd.org Received: from implode.root.com (root.com [209.102.106.178]) by hub.freebsd.org (Postfix) with ESMTP id 587A037BABD for ; Sun, 2 Apr 2000 19:17:18 -0700 (PDT) (envelope-from dg@implode.root.com) Received: from implode.root.com (localhost [127.0.0.1]) by implode.root.com (8.8.8/8.8.5) with ESMTP id TAA07259; Sun, 2 Apr 2000 19:09:52 -0700 (PDT) Message-Id: <200004030209.TAA07259@implode.root.com> To: nino@inode.at Cc: questions@FreeBSD.ORG Subject: Re: tuning the vm system / disk cache In-reply-to: Your message of "Mon, 03 Apr 2000 02:55:56 +0200." <20000403025556.S31173@TK147108.telekabel.at> From: David Greenman Reply-To: dg@root.com Date: Sun, 02 Apr 2000 19:09:52 -0700 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. I'm sure the system is already caching the entire file - evidence of this is the 438M of free memory, which the system would directly allocate from in order to cache the file. The only way I can explain the disk I/O is that there must be some writes taking place for some reason. -DG David Greenman Co-founder/Principal Architect, The FreeBSD Project - http://www.freebsd.org Creator of high-performance Internet servers - http://www.terasolutions.com Pave the road of life with opportunities. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message