2014년 12월 13일 토요일

Stoarge Cache and Page Sizes

I am trying to understand a bit about MongoDB's storage layer:
I understand that mongod process tries to get as much as memory as it can for memory mapped files, but I am wondering how I can find out:

Q1) What is the *actual* buffer-cache size, that a mongod process is really using ?
Q2) What is the page size that MongoDB uses to do I/O into its own managed buffer-cache.

hostInfo() command shows me the total memory that my server has (12GB) and the page size value is the OS page size (4096 bytes). But I am interested in realizing what is the page size that MongoDB itself uses inside its buffer-cache, and how much of memory (out of total potentially available memory) is *actually* used as buffer-cache by the server ?



MongoDB doesn't have its own "page size" nor does it manage its own buffer-cache.  It delegates all that to the OS, so the page size is the OS page size, etc.

If by really using you mean the part of pages in RAM that it's actually touched (read or written) that's what "resident memory" value in output from mongostat is showing.



But using mongostat, while loading data, I see the following output, which says my res memory is just 9 MB.
But the fact is I have 12GB of Memory in my machine, and I am wondering why mongod process is not grabbing more, to enhance the performance.
Is there a way I can set that size, or at least give hint(s) to the server to use the available memory ?

insert  query update delete getmore command  vsize    res faults  netIn netOut  conn repl       time 
  9080      0      0      0       0     455   316m     9m      0     3m    26k     3  RTR   15:38:52 
  4240      0      0      0       0     213   316m     9m      0     1m    12k     3  RTR   15:38:53 
  1220      0      0      0       0      64   316m     9m      0   417k     5k     3  RTR   15:38:54 
  8800      0      0      0       0     441   316m     9m      0     3m    25k     3  RTR   15:38:55 
  6600      0      0      0       0     331   316m     9m      0     2m    19k     3  RTR   15:38:56 
  7520      0      0      0       0     377   316m     9m      0     2m    21k     3  RTR   15:38:57 
  4960      0      0      0       0     249   316m     9m      0     1m    14k     3  RTR   15:38:58 
  8860      0      0      0       0     446   316m     9m      0     3m    26k     3  RTR   15:38:59 
  8800      0      0      0       0     441   316m     9m      0     3m    25k     3  RTR   15:39:00 
  9320      0      0      0       0     467   316m     9m      0     3m    26k     3  RTR   15:39:01



You have other things running on this system (like the OS, etc) - it's
likely there isn't more than 9G available to the file cache.


댓글 없음:

댓글 쓰기