From owner-freebsd-questions@FreeBSD.ORG Tue Jul 21 10:07:27 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E7E1106566C for ; Tue, 21 Jul 2009 10:07:27 +0000 (UTC) (envelope-from vel@infotecs.biz) Received: from fb2.internet4you.de (fb2.internet4you.de [85.158.3.233]) by mx1.freebsd.org (Postfix) with ESMTP id 5A4EB8FC16 for ; Tue, 21 Jul 2009 10:07:27 +0000 (UTC) (envelope-from vel@infotecs.biz) Received: from server10068.yco.de (server10068.yco.de [85.158.1.216]) by fb2.internet4you.de (Postfix) with ESMTP id BFC1810CCD8 for ; Tue, 21 Jul 2009 11:37:34 +0200 (CEST) Received: from mailgw6.internet4you.de (mailgw6.internet4you.de [85.158.1.60]) by server10068.yco.de (Postfix) with ESMTP id 588303144FA for ; Tue, 21 Jul 2009 11:42:05 +0200 (CEST) X-Virus-Scanned: at mailgw6.internet4you.de Received: from vorokovts (broadband-77-37-136-96.nationalcablenetworks.ru [77.37.136.96]) by server10068.yco.de (Postfix) with ESMTP id 965D731452C for ; Tue, 21 Jul 2009 11:42:02 +0200 (CEST) From: "Eugene L. Vorokov" To: Date: Tue, 21 Jul 2009 13:35:17 +0400 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 Thread-Index: AcoJrL8b7eJVx33EQxKX+P+weOQiFQAOVaPQ Subject: Disk cache tuning X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2009 10:07:28 -0000 Hello guys, I have an amd64 server with 8 cpu cores and 16Gb of memory, with FreeBSD 7.2. It is used as a corporate CVS server with several huge repositories (about 2Gb each), which consist of thousands of rather small files. I need to tune the system so that it caches as much files as possible and minimizes physical access to the disk. Of course, I did enable softupdates, but I have an impression that more things can be tuned. Specifically, I have read in many places that FreeBSD uses all available memory for disk cache, because disk buffers are integrated with vm pager. However, when I do cvs checkout to the same disk where the repository resides and watch memory usage (by top or systat), repeating that several times to activate the cache, I notice that for 2Gb repository system hardly uses more than 1Gb of memory (including inactive) even after 3-4 checkouts of the same repository, and disk is still used a lot. Why this happens ? How can I tell the system to use as much memory for caching as possible ? I also notice that the buffer cache expires pretty fast: the first checkout takes 2 minutes, if I do checkout again immediately, it takes 1.5 minutes, but if I do it again after waiting a minute, it takes 2 minutes again, even though the machine was completely inactive while I was waiting. Why the cache expires at all when there is a lot of free memory ? Can I somehow tell the system to keep everything cached until something is modified or some process needs memory ? Thank you in advance, please Cc: me as I'm not on this list. If there is more appropriate list for my questions, please point me to one. Regards, Eugene