Date: Sun, 02 Apr 2000 19:09:52 -0700 From: David Greenman <dg@root.com> To: nino@inode.at Cc: questions@FreeBSD.ORG Subject: Re: tuning the vm system / disk cache Message-ID: <200004030209.TAA07259@implode.root.com> In-Reply-To: Your message of "Mon, 03 Apr 2000 02:55:56 %2B0200." <20000403025556.S31173@TK147108.telekabel.at>
next in thread | previous in thread | raw e-mail | index | archive | help
>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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200004030209.TAA07259>