3

I have two PostgreSQL databases named data-1 and data-2 that sit on the same machine. Both databases keep 40 GB of data, and the total memory available on the machine is 68GB.

I started data-1 and data-2, and ran several queries to go over all their data. Then, I shut down data-1 and kept issuing queries against data-2. For some reason, the OS still holds on to large parts of data-1's pages in its page cache, and reserves about 35 GB of RAM to data-2's files. As a result, my queries on data-2 keep hitting disk.

I'm checking page cache usage with fincore. When I run a table scan query against data-2, I see that data-2's pages get evicted and put back into the cache in a round-robin manner. Nothing happens to data-1's pages, although they haven't been touched for days.

Does anybody know why data-1's pages aren't evicted from the page cache? I'm open to all kind of suggestions you think it might relate to problem.

This is an EC2 m2.4xlarge instance on Amazon with 68 GB of RAM and no swap space. The kernel version is:

$ uname -r
3.2.28-45.62.amzn1.x86_64

Edit-1:

It seems that there is no NUMA configuration:

$ dmesg | grep -i numa
[    0.000000] No NUMA configuration found

Edit-2:

I used page-types tool in Linux kernel source tree to monitor page cache statuses. From the results I conclude that:

data-1 pages are in state : referenced,uptodate,lru,active,private
data-2 pages are in state : referenced,uptodate,lru,mappedtodisk
4

1 回答 1

1

看看您在 中配置的 cpusets /dev/cpusets。如果您在这里有多个目录,那么您就有多个 cpuset,并且可能有多个内存节点。

此处详细记录了 cpusets 机制:http: //www.kernel.org/doc/man-pages/online/pages/man7/cpuset.7.html

于 2012-11-20T12:30:12.323 回答