From: "Kevin Burton" <burton@tailrank.com>
To: "FD Cami" <francois.cami@free.fr>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Ability to limit or disable page caching?
Date: Mon, 5 May 2008 12:42:31 -0700 [thread overview]
Message-ID: <30c6373b0805051242o2f38f0a3v62bd43f4fa01559e@mail.gmail.com> (raw)
In-Reply-To: <20080505212831.22371732@olorin>
Yeah... I wanted to explain it in detail in a longer post. If
necessary I'll do that as well.
I have a database process that's using 3G of memory. Then I have a
secondary process that's using about 500MB of memory. This leaves
about 500MB free for anything else. The box has 4GB of memory total...
No swap is needed.
... swappiness is set to zero.
I've verified that overcommit or other issues aren't getting in the
way as I can run the box without swap. This isn't possible when in
production though.
What's happening is that the kernel is deciding to swap out some
memory to disk in the (false) belief that it can free some up for
cache.
The problem is my database is already using its own cache so these are
conflicting philosophies here which make Linux perform in a
pathological way..
We're using O_DIRECT for our database which helps reduce the problem a
bit...... O_DIRECT bypasses the page cache and does all IO directly.
This means there isn't much pressure on the page cache and pages
aren't swapped out to disk. However, MySQL still needs to do reads on
misc files which aren't O_DIRECT so I end up swapping but at a much
slower rate.
What I want to do is either disable the page cache entirely or just
tell the OS to cache at max 10% of the available memory.
Thoughts?
Kevin
On Mon, May 5, 2008 at 12:28 PM, FD Cami <francois.cami@free.fr> wrote:
> On Mon, 5 May 2008 11:34:24 -0700
> "Kevin Burton" <burtonator@gmail.com> wrote:
>
>> >> In the mean time is it possible to disable the page cache or limit it
>> >> to say 10% of system memory?
>> >
>> > You might want to look at /proc/sys/vm/ for tunables.
>> > /proc/sys/vm/vfs_cache_pressure and /proc/sys/vm/swappiness are probably
>> > what you are looking for.
>>
>> I haven't played with vfs_cache_pressure so I'll take a look at this.
>>
>> Unfortunately, swappiness doesn't work as intended.
>
> Could you explain the original problem ? That way we might help you better.
>
> Best,
>
> Francois
>
--
Founder/CEO Tailrank.com
Location: San Francisco, CA
AIM/YIM: sfburtonator
Skype: burtonator
Work: http://spinn3r.com and http://tailrank.com
Blog: http://feedblog.org
Cell: 415-637-8078
Fax: 1-415-358-419 PIN: 0092
next prev parent reply other threads:[~2008-05-05 19:42 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-05 7:12 Ability to limit or disable page caching? Kevin Burton
2008-05-05 11:16 ` FD Cami
2008-05-05 18:34 ` Kevin Burton
2008-05-05 19:28 ` FD Cami
2008-05-05 19:42 ` Kevin Burton [this message]
2008-05-05 20:10 ` Andi Kleen
2008-05-05 20:28 ` Kevin Burton
2008-05-05 20:31 ` Kevin Burton
2008-05-05 20:40 ` Kevin Burton
2008-05-06 0:23 ` Andi Kleen
2008-05-06 0:30 ` Kevin Burton
2008-05-05 21:24 ` Bernd Eckenfels
2008-05-05 20:44 ` Rik van Riel
2008-05-05 21:00 ` Kevin Burton
2008-05-05 22:08 ` Rik van Riel
2008-05-05 22:15 ` Kevin Burton
2008-05-08 2:08 ` split LRU kernel RPM Rik van Riel
2008-05-05 21:03 ` Ability to limit or disable page caching? Chris Friesen
2008-05-05 21:32 ` Kevin Burton
2008-05-05 22:06 ` Rik van Riel
2008-05-06 11:02 ` Tomasz Kłoczko
2008-05-05 19:33 ` Kevin Burton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=30c6373b0805051242o2f38f0a3v62bd43f4fa01559e@mail.gmail.com \
--to=burton@tailrank.com \
--cc=francois.cami@free.fr \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox