在CentOS 6.3上查找postgres共享内存段的大小



我正在尝试使用Postgres 9.3.1和CentOS 6.3版(最终版)调试一些共享内存问题。使用top,我可以看到许多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没有显示更大的片段?我应该使用不同的命令吗?

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

最新更新