Message from discussion
How to keep it all in RAM ?
Received: by 10.52.88.174 with SMTP id bh14mr19920055vdb.6.1341486392762;
Thu, 05 Jul 2012 04:06:32 -0700 (PDT)
X-BeenThere: mongodb-user@googlegroups.com
Received: by 10.52.30.193 with SMTP id u1ls4608037vdh.8.gmail; Thu, 05 Jul
2012 04:06:24 -0700 (PDT)
Received: by 10.52.94.147 with SMTP id dc19mr934435vdb.17.1341486384666;
Thu, 05 Jul 2012 04:06:24 -0700 (PDT)
Date: Thu, 5 Jul 2012 04:06:24 -0700 (PDT)
From: Laurent Vaills <laurent.vai...@gmail.com>
To: mongodb-user@googlegroups.com
Message-Id: <db8bf880-7388-495f-9451-d0976434a1bb@googlegroups.com>
In-Reply-To: <CA+C=T4C80RRSQBdFhOogjG0K3yRnYeuz+2j_DrEG5gcqGdxr=g@mail.gmail.com>
References: <bc0a2d99-04c2-4f4d-b0da-6d83de9559c0@googlegroups.com>
<CA+C=T4C80RRSQBdFhOogjG0K3yRnYeuz+2j_DrEG5gcqGdxr=g@mail.gmail.com>
Subject: Re: [mongodb-user] How to keep it all in RAM ?
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_Part_214_24275159.1341486384308"
------=_Part_214_24275159.1341486384308
Content-Type: multipart/alternative;
boundary="----=_Part_215_4268794.1341486384308"
------=_Part_215_4268794.1341486384308
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Hi Eliott,
here is the output that you requested :
$ free -m
total used free shared buffers cached
Mem: 32230 24489 7740 0 51 23367
-/+ buffers/cache: 1070 31160
Swap: 4000 11 3989
$ sudo blockdev --report
RO RA SSZ BSZ StartSec Size Device
rw 256 512 4096 0 584652423168 /dev/sda
rw 256 512 4096 63 2097414144 /dev/sda1
rw 256 512 4096 4096575 4194892800 /dev/sda2
rw 256 512 4096 12289725 4194892800 /dev/sda3
rw 256 512 1024 20482875 1024 /dev/sda4
rw 256 512 4096 20482938 20974431744 /dev/sda5
rw 256 512 4096 61448688 1052803584 /dev/sda6
rw 256 512 4096 63505008 12584646144 /dev/sda7
rw 256 512 512 88084458 539545434624 /dev/sda8
I googled a little about the blockdev and the tunings which can be done.
Assuming the current output, I would suggest to increase the RA from 256 to
at least 1024 and maybe lot more (I read about setting to 16384 (8MB)).
But maybe, you (or someone else) have some other advices.
Regards,
Laurent
On Thursday, July 5, 2012 2:35:28 AM UTC+2, Eliot Horowitz wrote:
>
> Can you send the output of:
> "free -m"
> and
> "sudo blockdev --report"
> Most likely something at the storage level isn't tuned
>
> On Wed, Jul 4, 2012 at 10:32 AM, Laurent Vaills
> <laurent.vai...@gmail.com> wrote:
> > Hi,
> >
> > I'am experiencing some performances problems in our mongo replicat set.
> > It is built with 3 hosts with 32 Gb RAM each with no sharding currently
> > running on Debian 6, 64 bits.
> >
> > Here is the statistics of our database :
> >> db.stats();
> > {
> > "db" : "bss",
> > "collections" : 3,
> > "objects" : 20402919,
> > "avgObjSize" : 4222.7186184486645,
> > "dataSize" : 86155785932,
> > "storageSize" : 83538116000,
> > "numExtents" : 42,
> > "indexes" : 20,
> > "indexSize" : 16388563072,
> > "fileSize" : 115841433600,
> > "nsSizeMB" : 16,
> > "ok" : 1
> > }
> > (3 collections are defined but we are really using only 1)
> >
> > From top or htop, I see that only a little bit more than 1G of memory is
> > used on my machine.
> >
> > From mongostat :
> > insert query update delete getmore command flushes mapped vsize res
> > *0 1 *3 *0 0 3|0 0 128g 257g 581m
> > *0 *0 *7 *0 0 5|0 0 128g 257g 581m
> > *0 *0 *2 *0 0 7|0 0 128g 257g 581m
> > *0 *0 *3 *0 0 3|0 0 128g 257g 581m
> > *1 *0 *1 *0 0 5|0 0 128g 257g 581m
> > *0 *0 *1 *0 0 3|0 0 128g 257g 581m
> > *1 *0 *12 *0 0 3|0 0 128g 257g 581m
> > *1 *0 *4 *0 0 5|0 0 128g 257g 582m
> > *0 *0 *8 *0 0 9|0 0 128g 257g 581m
> > *0 1 *6 *0 0 1|0 0 128g 257g 581m
> >
> > I understand that MongoDB has only 581m in resident memory which is not
> the
> > size of all the indexes.
> >
> > After some reading
> > (
> http://answers.dotcloud.com/question/566/difference-in-mongodb-memory-usage-reported
> > and
> >
> http://blog.serverdensity.com/2010/12/13/mongodb-monitoring-keep-in-it-ram/
> > ) I understand that MongoDB is using mmap.
> >
> > We have some batches that iterates a lot of documents of our collection
> and
> > this is quite slow because we have a lot of page faults.
> >
> > Everything that I read about MongoDB says to "keep all in RAM" but I
> never
> > found the way to achieve that. Are there some special settings to tune
> in
> > order that MongoDB really puts at least all its indexes in RAM and
> 'caches'
> > more data in RAM than it currently does. I would be very happy to see
> the
> > number of page faults down even even when my batches are running.
> >
> > Regards,
> > Laurent
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "mongodb-user" group.
> > To post to this group, send email to mongodb-user@googlegroups.com
> > To unsubscribe from this group, send email to
> > mongodb-user+unsubscribe@googlegroups.com
> > See also the IRC channel -- freenode.net#mongodb
>
On Thursday, July 5, 2012 2:35:28 AM UTC+2, Eliot Horowitz wrote:
>
> Can you send the output of:
> "free -m"
> and
> "sudo blockdev --report"
> Most likely something at the storage level isn't tuned
>
> On Wed, Jul 4, 2012 at 10:32 AM, Laurent Vaills
> <laurent.vai...@gmail.com> wrote:
> > Hi,
> >
> > I'am experiencing some performances problems in our mongo replicat set.
> > It is built with 3 hosts with 32 Gb RAM each with no sharding currently
> > running on Debian 6, 64 bits.
> >
> > Here is the statistics of our database :
> >> db.stats();
> > {
> > "db" : "bss",
> > "collections" : 3,
> > "objects" : 20402919,
> > "avgObjSize" : 4222.7186184486645,
> > "dataSize" : 86155785932,
> > "storageSize" : 83538116000,
> > "numExtents" : 42,
> > "indexes" : 20,
> > "indexSize" : 16388563072,
> > "fileSize" : 115841433600,
> > "nsSizeMB" : 16,
> > "ok" : 1
> > }
> > (3 collections are defined but we are really using only 1)
> >
> > From top or htop, I see that only a little bit more than 1G of memory is
> > used on my machine.
> >
> > From mongostat :
> > insert query update delete getmore command flushes mapped vsize res
> > *0 1 *3 *0 0 3|0 0 128g 257g 581m
> > *0 *0 *7 *0 0 5|0 0 128g 257g 581m
> > *0 *0 *2 *0 0 7|0 0 128g 257g 581m
> > *0 *0 *3 *0 0 3|0 0 128g 257g 581m
> > *1 *0 *1 *0 0 5|0 0 128g 257g 581m
> > *0 *0 *1 *0 0 3|0 0 128g 257g 581m
> > *1 *0 *12 *0 0 3|0 0 128g 257g 581m
> > *1 *0 *4 *0 0 5|0 0 128g 257g 582m
> > *0 *0 *8 *0 0 9|0 0 128g 257g 581m
> > *0 1 *6 *0 0 1|0 0 128g 257g 581m
> >
> > I understand that MongoDB has only 581m in resident memory which is not
> the
> > size of all the indexes.
> >
> > After some reading
> > (
> http://answers.dotcloud.com/question/566/difference-in-mongodb-memory-usage-reported
> > and
> >
> http://blog.serverdensity.com/2010/12/13/mongodb-monitoring-keep-in-it-ram/
> > ) I understand that MongoDB is using mmap.
> >
> > We have some batches that iterates a lot of documents of our collection
> and
> > this is quite slow because we have a lot of page faults.
> >
> > Everything that I read about MongoDB says to "keep all in RAM" but I
> never
> > found the way to achieve that. Are there some special settings to tune
> in
> > order that MongoDB really puts at least all its indexes in RAM and
> 'caches'
> > more data in RAM than it currently does. I would be very happy to see
> the
> > number of page faults down even even when my batches are running.
> >
> > Regards,
> > Laurent
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "mongodb-user" group.
> > To post to this group, send email to mongodb-user@googlegroups.com
> > To unsubscribe from this group, send email to
> > mongodb-user+unsubscribe@googlegroups.com
> > See also the IRC channel -- freenode.net#mongodb
>
------=_Part_215_4268794.1341486384308
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Hi Eliott,<div><br></div><div>here is the output that you requested : =
</div><div><font face=3D"courier new, monospace">$ free -m</font></div><div=
><div><font face=3D"courier new, monospace"> &nb=
sp; total used free =
shared buffers cached</font></div>=
<div><font face=3D"courier new, monospace">Mem: =
32230 24489 7740 &n=
bsp; 0 51 2336=
7</font></div><div><font face=3D"courier new, monospace">-/+ buffers/cache:=
1070 31160</font></div><div><font=
face=3D"courier new, monospace">Swap: 4000 &nb=
sp; 11 3989</font></div></div><di=
v><br></div><div>$ sudo blockdev --report</div><div><div><font face=3D=
"courier new, monospace">RO RA SSZ BSZ St=
artSec Size Device</font></=
div><div><font face=3D"courier new, monospace">rw 256 512 &nb=
sp;4096 0 584652423168  =
; /dev/sda</font></div><div><font face=3D"courier new, monospace">rw =
256 512 4096 63 &nb=
sp;2097414144 /dev/sda1</font></div><div><font face=3D"courier new, =
monospace">rw 256 512 4096 4096575 =
4194892800 /dev/sda2</font></div><div><font face=3D"cou=
rier new, monospace">rw 256 512 4096 12289725 &n=
bsp; 4194892800 /dev/sda3</font></div><div><font face=
=3D"courier new, monospace">rw 256 512 1024 2048=
2875 1024 /dev/sda4</font><=
/div><div><font face=3D"courier new, monospace">rw 256 512 &n=
bsp;4096 20482938 20974431744 /dev/sda5</font><=
/div><div><font face=3D"courier new, monospace">rw 256 512 &n=
bsp;4096 61448688 1052803584 /dev/sda6</f=
ont></div><div><font face=3D"courier new, monospace">rw 256 5=
12 4096 63505008 12584646144 /dev/sda7</f=
ont></div><div><font face=3D"courier new, monospace">rw 256 5=
12 512 88084458 539545434624 /dev/sda8</f=
ont></div></div><div><br></div><div>I googled a little about the blockdev a=
nd the tunings which can be done. Assuming the current output, I would sugg=
est to increase the RA from 256 to at least 1024 and maybe lot more (I read=
about setting to 16384 (8MB)). </div><div><br></div><div>But maybe, =
you (or someone else) have some other advices.</div><div><br></div><div>Reg=
ards,</div><div>Laurent</div><div><br><div><br>On Thursday, July 5, 2012 2:=
35:28 AM UTC+2, Eliot Horowitz wrote:<blockquote class=3D"gmail_quote" styl=
e=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left:=
1ex;">Can you send the output of:
<br>"free -m"
<br>and
<br>"sudo blockdev --report"
<br>Most likely something at the storage level isn't tuned
<br>
<br>On Wed, Jul 4, 2012 at 10:32 AM, Laurent Vaills
<br><<a href=3D"mailto:laurent.vai...@gmail.com" target=3D"_blank">laure=
nt.vai...@gmail.com</a>> wrote:
<br>> Hi,
<br>>
<br>> I'am experiencing some performances problems in our mongo replicat=
set.
<br>> It is built with 3 hosts with 32 Gb RAM each with no sharding curr=
ently
<br>> running on Debian 6, 64 bits.
<br>>
<br>> Here is the statistics of our database :
<br>>> db.stats();
<br>> {
<br>> "db" : "bss",
<br>> "collections" : 3,
<br>> "objects" : 20402919,
<br>> "avgObjSize" : 4222.7186184486645,
<br>> "dataSize" : 86155785932,
<br>> "storageSize" : 83538116000,
<br>> "numExtents" : 42,
<br>> "indexes" : 20,
<br>> "indexSize" : 16388563072,
<br>> "fileSize" : 115841433600,
<br>> "nsSizeMB" : 16,
<br>> "ok" : 1
<br>> }
<br>> (3 collections are defined but we are really using only 1)
<br>>
<br>> From top or htop, I see that only a little bit more than 1G of mem=
ory is
<br>> used on my machine.
<br>>
<br>> From mongostat :
<br>> insert query update delete getmore command flushes mapped &n=
bsp;vsize res
<br>> *0 1 *3 &nb=
sp; *0 0 3|0 0 &nbs=
p; 128g 257g 581m
<br>> *0 *0 *7 *=
0 0 5|0 0 12=
8g 257g 581m
<br>> *0 *0 *2 *=
0 0 7|0 0 12=
8g 257g 581m
<br>> *0 *0 *3 *=
0 0 3|0 0 12=
8g 257g 581m
<br>> *1 *0 *1 *=
0 0 5|0 0 12=
8g 257g 581m
<br>> *0 *0 *1 *=
0 0 3|0 0 12=
8g 257g 581m
<br>> *1 *0 *12 *=
0 0 3|0 0 12=
8g 257g 581m
<br>> *1 *0 *4 *=
0 0 5|0 0 12=
8g 257g 582m
<br>> *0 *0 *8 *=
0 0 9|0 0 12=
8g 257g 581m
<br>> *0 1 *6 &nb=
sp; *0 0 1|0 0 &nbs=
p; 128g 257g 581m
<br>>
<br>> I understand that MongoDB has only 581m in resident memory which i=
s not the
<br>> size of all the indexes.
<br>>
<br>> After some reading
<br>> (<a href=3D"http://answers.dotcloud.com/question/566/difference-in=
-mongodb-memory-usage-reported" target=3D"_blank">http://answers.dotcloud.c=
om/<wbr>question/566/difference-in-<wbr>mongodb-memory-usage-reported</a>
<br>> and
<br>> <a href=3D"http://blog.serverdensity.com/2010/12/13/mongodb-monito=
ring-keep-in-it-ram/" target=3D"_blank">http://blog.serverdensity.com/<wbr>=
2010/12/13/mongodb-monitoring-<wbr>keep-in-it-ram/</a>
<br>> ) I understand that MongoDB is using mmap.
<br>>
<br>> We have some batches that iterates a lot of documents of our colle=
ction and
<br>> this is quite slow because we have a lot of page faults.
<br>>
<br>> Everything that I read about MongoDB says to "keep all in RAM" but=
I never
<br>> found the way to achieve that. Are there some special settings to =
tune in
<br>> order that MongoDB really puts at least all its indexes in RAM and=
'caches'
<br>> more data in RAM than it currently does. I would be very happy to =
see the
<br>> number of page faults down even even when my batches are running.
<br>>
<br>> Regards,
<br>> Laurent
<br>>
<br>> --
<br>> You received this message because you are subscribed to the Google
<br>> Groups "mongodb-user" group.
<br>> To post to this group, send email to <a href=3D"mailto:mongodb-use=
r@googlegroups.com" target=3D"_blank">mongodb-user@googlegroups.com</a>
<br>> To unsubscribe from this group, send email to
<br>> <a href=3D"mailto:mongodb-user%2Bunsubscribe@googlegroups.com" tar=
get=3D"_blank">mongodb-user+unsubscribe@<wbr>googlegroups.com</a>
<br>> See also the IRC channel -- <a href=3D"http://freenode.net#mongodb=
" target=3D"_blank">freenode.net#mongodb</a>
<br></blockquote></div></div><br>On Thursday, July 5, 2012 2:35:28 AM UTC+2=
, Eliot Horowitz wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0=
;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">Can you=
send the output of:
<br>"free -m"
<br>and
<br>"sudo blockdev --report"
<br>Most likely something at the storage level isn't tuned
<br>
<br>On Wed, Jul 4, 2012 at 10:32 AM, Laurent Vaills
<br><<a href=3D"mailto:laurent.vai...@gmail.com" target=3D"_blank">laure=
nt.vai...@gmail.com</a>> wrote:
<br>> Hi,
<br>>
<br>> I'am experiencing some performances problems in our mongo replicat=
set.
<br>> It is built with 3 hosts with 32 Gb RAM each with no sharding curr=
ently
<br>> running on Debian 6, 64 bits.
<br>>
<br>> Here is the statistics of our database :
<br>>> db.stats();
<br>> {
<br>> "db" : "bss",
<br>> "collections" : 3,
<br>> "objects" : 20402919,
<br>> "avgObjSize" : 4222.7186184486645,
<br>> "dataSize" : 86155785932,
<br>> "storageSize" : 83538116000,
<br>> "numExtents" : 42,
<br>> "indexes" : 20,
<br>> "indexSize" : 16388563072,
<br>> "fileSize" : 115841433600,
<br>> "nsSizeMB" : 16,
<br>> "ok" : 1
<br>> }
<br>> (3 collections are defined but we are really using only 1)
<br>>
<br>> From top or htop, I see that only a little bit more than 1G of mem=
ory is
<br>> used on my machine.
<br>>
<br>> From mongostat :
<br>> insert query update delete getmore command flushes mapped &n=
bsp;vsize res
<br>> *0 1 *3 &nb=
sp; *0 0 3|0 0 &nbs=
p; 128g 257g 581m
<br>> *0 *0 *7 *=
0 0 5|0 0 12=
8g 257g 581m
<br>> *0 *0 *2 *=
0 0 7|0 0 12=
8g 257g 581m
<br>> *0 *0 *3 *=
0 0 3|0 0 12=
8g 257g 581m
<br>> *1 *0 *1 *=
0 0 5|0 0 12=
8g 257g 581m
<br>> *0 *0 *1 *=
0 0 3|0 0 12=
8g 257g 581m
<br>> *1 *0 *12 *=
0 0 3|0 0 12=
8g 257g 581m
<br>> *1 *0 *4 *=
0 0 5|0 0 12=
8g 257g 582m
<br>> *0 *0 *8 *=
0 0 9|0 0 12=
8g 257g 581m
<br>> *0 1 *6 &nb=
sp; *0 0 1|0 0 &nbs=
p; 128g 257g 581m
<br>>
<br>> I understand that MongoDB has only 581m in resident memory which i=
s not the
<br>> size of all the indexes.
<br>>
<br>> After some reading
<br>> (<a href=3D"http://answers.dotcloud.com/question/566/difference-in=
-mongodb-memory-usage-reported" target=3D"_blank">http://answers.dotcloud.c=
om/<wbr>question/566/difference-in-<wbr>mongodb-memory-usage-reported</a>
<br>> and
<br>> <a href=3D"http://blog.serverdensity.com/2010/12/13/mongodb-monito=
ring-keep-in-it-ram/" target=3D"_blank">http://blog.serverdensity.com/<wbr>=
2010/12/13/mongodb-monitoring-<wbr>keep-in-it-ram/</a>
<br>> ) I understand that MongoDB is using mmap.
<br>>
<br>> We have some batches that iterates a lot of documents of our colle=
ction and
<br>> this is quite slow because we have a lot of page faults.
<br>>
<br>> Everything that I read about MongoDB says to "keep all in RAM" but=
I never
<br>> found the way to achieve that. Are there some special settings to =
tune in
<br>> order that MongoDB really puts at least all its indexes in RAM and=
'caches'
<br>> more data in RAM than it currently does. I would be very happy to =
see the
<br>> number of page faults down even even when my batches are running.
<br>>
<br>> Regards,
<br>> Laurent
<br>>
<br>> --
<br>> You received this message because you are subscribed to the Google
<br>> Groups "mongodb-user" group.
<br>> To post to this group, send email to <a href=3D"mailto:mongodb-use=
r@googlegroups.com" target=3D"_blank">mongodb-user@googlegroups.com</a>
<br>> To unsubscribe from this group, send email to
<br>> <a href=3D"mailto:mongodb-user%2Bunsubscribe@googlegroups.com" tar=
get=3D"_blank">mongodb-user+unsubscribe@<wbr>googlegroups.com</a>
<br>> See also the IRC channel -- <a href=3D"http://freenode.net#mongodb=
" target=3D"_blank">freenode.net#mongodb</a>
<br></blockquote>
------=_Part_215_4268794.1341486384308--
------=_Part_214_24275159.1341486384308--