2013-12-11 79 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