From: Tomasz Chmielewski <mangoo@wpkg.org>
To: LVM general discussion and development <linux-lvm@redhat.com>
Subject: Re: [linux-lvm] how much memory does LVM need? oom-killer comes
Date: Tue, 04 Sep 2007 11:32:17 +0200 [thread overview]
Message-ID: <46DD2621.1010608@wpkg.org> (raw)
In-Reply-To: <Pine.LNX.4.44.0709031201030.18181-100000@bmsred.bmsi.com>
Stuart D. Gathman schrieb:
> On Mon, 3 Sep 2007, Tomasz Chmielewski wrote:
>
>> Again, replying to myself, as no one on this list seem to have a clue
>> about problems with LVM snapshots... I added RAM, and was able to boot
>> again.
>
> I may have an answer after all. I suspect that the chunksize parameter
> to lvcreate -s will affect memory use. A larger chunksize should use
> less memory.
>
>> So, as a rule of thumb, we can say that for each *used* GB of snapshot,
>> ~3 MB of RAM is needed.
>
> On my snapshots on Centos-5, the chunksize defaults to 8k. With your
> observation of 3MB per Gig of snapshot, that comes to 24 bytes per chunk.
> Quite reasonable. If you make your chunksize 512K (the maximum supported),
> memory use should change to 48K per Gig.
>
> lvdisplay will show the chunksize for a snapshot.
Indeed, it was 8 kB.
What is the meaning of the chunksize in snapshots?
With 512 kB chunksize, I guess the snapshot will fill faster than with 8
KB chunksize, given that the same amount of data changes?
Here is a quick test that shows it.
I created two 20 GB snapshots of a 20GB volume, one with 8kB, and the
other with 512 kB chunksize.
Then, I created a 50 MB file on the original volume (out of /dev/zero):
build1 san1 owi-ao 20.00G
build1-512 san1 swi-a- 20.00G build1 0.09
build1-8 san1 swi-a- 20.00G build1 0.08
Copying /bin, /boot and /lib (71 MB in total) into a new directory makes
that difference bigger:
build1 san1 owi-ao 20.00G
build1-512 san1 swi-a- 20.00G build1 0.76
build1-8 san1 swi-a- 20.00G build1 0.62
Copying a 1.2 GB /usr into a new directory shows this:
build1-512 san1 swi-a- 20.00G build1 7.40
build1-8 san1 swi-a- 20.00G build1 7.18
And finally, create 1000000 empty files:
build1 san1 owi-ao 20.00G
build1-512 san1 swi-a- 20.00G build1 8.22
build1-8 san1 swi-a- 20.00G build1 7.91
The difference is not that big, usually it should be below 5%.
--
Tomasz Chmielewski
http://wpkg.org
prev parent reply other threads:[~2007-09-04 9:32 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-01 20:13 [linux-lvm] how much memory does LVM need? oom-killer comes Tomasz Chmielewski
2007-09-01 20:22 ` Tomasz Chmielewski
2007-09-02 9:54 ` Tomasz Chmielewski
2007-09-03 9:34 ` Tomasz Chmielewski
2007-09-03 14:21 ` Stuart D. Gathman
2007-09-03 16:17 ` Tomasz Chmielewski
2007-09-03 16:09 ` Stuart D. Gathman
2007-09-04 9:32 ` Tomasz Chmielewski [this message]
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=46DD2621.1010608@wpkg.org \
--to=mangoo@wpkg.org \
--cc=linux-lvm@redhat.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.