numa_test.txt
text/plain
postgres=# select numa_zone_id, count(*) from pg_buffercache group by numa_zone_id;
NOTICE: os_page_count=32768 os_page_size=4096 pages_per_blk=2.000000
numa_zone_id | count
--------------+-------
| 16149
4 | 59
0 | 59
6 | 58
2 | 59
(5 rows)
postgres=# create table xx as select generate_series(1, 1000000);
SELECT 1000000
postgres=# select numa_zone_id, count(*) from pg_buffercache group by numa_zone_id;
NOTICE: os_page_count=32768 os_page_size=4096 pages_per_blk=2.000000
numa_zone_id | count
--------------+-------
| 14095
4 | 572
0 | 572
6 | 571
2 | 572
-2 | 2
(6 rows)
postgres=# show shared_buffers ;
shared_buffers
----------------
128MB
(1 row)
postgres=# select pg_backend_pid();
pg_backend_pid
----------------
14121
(1 row)
## and now from 14121:
postgres=# select numa_zone_id, count(*) from pg_buffercache group by numa_zone_id;
NOTICE: os_page_count=32768 os_page_size=4096 pages_per_blk=2.000000
numa_zone_id | count
--------------+-------
| 13439
4 | 46
0 | 48
6 | 47
2 | 47
-2 | 2757
## also, this wont give us detailed addr <-> specific NUMA node info:
postgres@jw-test3:~$ grep --color /dev/zero /proc/14121/numa_maps
7f5dd6004000 interleave:0-7 file=/dev/zero\040(deleted) dirty=6829 mapmax=7 active=0 N0=853 N1=853 N2=855 N3=853 N4=852 N5=854 N6=854 N7=855 kernelpagesize_kB=4