Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Jul 2009 13:35:17 +0400
From:      "Eugene L. Vorokov" <vel@infotecs.biz>
To:        <freebsd-questions@freebsd.org>
Subject:   Disk cache tuning
Message-ID:  <A270506A71A244B3B2B69723CA4EA80F@vorokovts>

next in thread | raw e-mail | index | archive | help
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
 





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?A270506A71A244B3B2B69723CA4EA80F>