2013-12-11 40 views
0

我想用Postgres 9.3.1和CentOS release 6.3(Final)调试一些共享内存问题。使用上面,我可以看到很多的Postgres连接的使用共享内存:在CentOS 6.3上查找postgres共享内存段的大小

PID USER  PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 
3534 postgres 20 0 2330m 1.4g 1.1g S 0.0 20.4 1:06.99 postgres: deploy mtalcott 10.222.154.172(53495) idle 
9143 postgres 20 0 2221m 1.1g 983m S 0.0 16.9 0:14.75 postgres: deploy mtalcott 10.222.154.167(35811) idle 
6026 postgres 20 0 2341m 1.1g 864m S 0.0 16.4 0:46.56 postgres: deploy mtalcott 10.222.154.167(37110) idle 
18538 postgres 20 0 2327m 1.1g 865m S 0.0 16.1 2:06.59 postgres: deploy mtalcott 10.222.154.172(47796) idle 
1575 postgres 20 0 2358m 1.1g 858m S 0.0 15.9 1:41.76 postgres: deploy mtalcott 10.222.154.172(52560) idle 
    ... 

大约有29总空闲连接。但是,sudo ipcs -m只显示:

------ Shared Memory Segments -------- 
key  shmid  owner  perms  bytes  nattch  status 
0x0052e2c1 163840  postgres 600  48   21 

令人惊讶的是,它只显示它使用48个字节。为什么ipcs显示较大的细分?我应该使用不同的命令吗?

回答

1

我认为这是因为你的postgre是版本9.3,它使用POSIX类型的共享内存。 ipcs -m显示sysV共享内存段,这些段在Postgre的早期版本中使用。

+0

这就是它。我在9.3中忘记了那个开关。 – mtalcott