Chinaunix

标题: postgres进程在不断增加,是什么原因? [打印本页]

作者: 林知枫    时间: 2009-04-10 17:13
标题: postgres进程在不断增加,是什么原因?
postgres进程在不断增加,是什么原因?

chch@debian:~$ ps auxww | grep ^postgre
postgres 2744 0.0 0.1 42628 5360 ? S 08:14 0:00 /usr/lib/postgresql/8.3/bin/postgres -D /home/postgresqls/main -c config_file=/etc/postgresql/8.3/main/postgresql.conf
postgres 2859 0.0 0.0 42628 1912 ? Ss 08:15 0:01 postgres: writer process
postgres 2860 0.0 0.0 42628 1268 ? Ss 08:15 0:01 postgres: wal writer process
postgres 2861 0.0 0.0 42896 1572 ? Ss 08:15 0:00 postgres: autovacuum launcher process
postgres 2862 0.0 0.0 14100 1292 ? Ss 08:15 0:05 postgres: stats collector process
postgres 6172 0.0 0.1 43592 4348 ? Ss 10:51 0:00 postgres: rlzy rlzy 127.0.0.1(51371) idle
postgres 6173 0.0 0.1 43324 3964 ? Ss 10:51 0:00 postgres: rlzy rlzy 127.0.0.1(51372) idle
postgres 6174 0.0 0.0 43204 2540 ? Ss 10:51 0:00 postgres: rlzy rlzy 127.0.0.1(51373) idle
postgres 6175 0.0 0.0 43204 2520 ? Ss 10:51 0:00 postgres: rlzy rlzy 127.0.0.1(51374) idle
postgres 6176 0.0 0.0 43204 2524 ? Ss 10:51 0:00 postgres: rlzy rlzy 127.0.0.1(51375) idle
postgres 6183 0.0 0.0 43204 2528 ? Ss 10:51 0:00 postgres: rlzy rlzy 127.0.0.1(51380) idle
postgres 6184 0.0 0.0 43204 2536 ? Ss 10:51 0:00 postgres: rlzy rlzy 127.0.0.1(51381) idle
postgres 6185 0.0 0.0 43204 2528 ? Ss 10:51 0:00 postgres: rlzy rlzy 127.0.0.1(51382) idle
postgres 6186 0.0 0.0 43204 2524 ? Ss 10:51 0:00 postgres: rlzy rlzy 127.0.0.1(51383) idle
postgres 6187 0.0 0.0 43204 2528 ? Ss 10:51 0:00 postgres: rlzy rlzy 127.0.0.1(51384) idle
postgres 6339 0.0 0.2 44464 7000 ? Ss 11:02 0:00 postgres: rlzy rlzy 127.0.0.1(44099) idle
postgres 6613 0.0 0.1 43592 4308 ? Ss 11:40 0:00 postgres: rlzy rlzy 127.0.0.1(54994) idle
postgres 6614 0.0 0.1 43324 3956 ? Ss 11:40 0:00 postgres: rlzy rlzy 127.0.0.1(54995) idle
postgres 6615 0.0 0.0 43208 2520 ? Ss 11:40 0:00 postgres: rlzy rlzy 127.0.0.1(54996) idle
postgres 6616 0.0 0.0 43208 2528 ? Ss 11:40 0:00 postgres: rlzy rlzy 127.0.0.1(54997) idle
postgres 6617 0.0 0.0 43208 2528 ? Ss 11:40 0:00 postgres: rlzy rlzy 127.0.0.1(5499 idle
postgres 6623 0.0 0.0 43208 2524 ? Ss 11:40 0:00 postgres: rlzy rlzy 127.0.0.1(55003) idle
postgres 6624 0.0 0.0 43208 2524 ? Ss 11:40 0:00 postgres: rlzy rlzy 127.0.0.1(55004) idle
postgres 6625 0.0 0.0 43208 2520 ? Ss 11:40 0:00 postgres: rlzy rlzy 127.0.0.1(55005) idle
postgres 6626 0.0 0.0 43208 2524 ? Ss 11:40 0:00 postgres: rlzy rlzy 127.0.0.1(55006) idle
postgres 6627 0.0 0.0 43208 2520 ? Ss 11:40 0:00 postgres: rlzy rlzy 127.0.0.1(55007) idle
postgres 6668 0.0 0.1 43592 4556 ? Ss 11:44 0:00 postgres: rlzy rlzy 127.0.0.1(55031) idle
postgres 6669 0.0 0.1 43324 3956 ? Ss 11:44 0:00 postgres: rlzy rlzy 127.0.0.1(55032) idle
postgres 6670 0.0 0.0 43208 2532 ? Ss 11:44 0:00 postgres: rlzy rlzy 127.0.0.1(55033) idle
postgres 6671 0.0 0.0 43208 2528 ? Ss 11:44 0:00 postgres: rlzy rlzy 127.0.0.1(55034) idle
postgres 6672 0.0 0.0 43208 2524 ? Ss 11:44 0:00 postgres: rlzy rlzy 127.0.0.1(55035) idle
postgres 6679 0.0 0.0 43208 2524 ? Ss 11:44 0:00 postgres: rlzy rlzy 127.0.0.1(55040) idle
postgres 6680 0.0 0.0 43208 2524 ? Ss 11:44 0:00 postgres: rlzy rlzy 127.0.0.1(55041) idle
postgres 6681 0.0 0.0 43208 2524 ? Ss 11:44 0:00 postgres: rlzy rlzy 127.0.0.1(55042) idle
postgres 6682 0.0 0.0 43208 2524 ? Ss 11:44 0:00 postgres: rlzy rlzy 127.0.0.1(55043) idle
postgres 6683 0.0 0.0 43208 2524 ? Ss 11:44 0:00 postgres: rlzy rlzy 127.0.0.1(55044) idle
postgres 6873 0.0 0.1 43592 4380 ? Ss 11:55 0:00 postgres: rlzy rlzy 127.0.0.1(50791) idle
postgres 6874 0.0 0.1 43668 4656 ? Ss 11:55 0:00 postgres: rlzy rlzy 127.0.0.1(50792) idle
postgres 6875 0.0 0.1 43324 3960 ? Ss 11:55 0:00 postgres: rlzy rlzy 127.0.0.1(50793) idle
postgres 6876 0.0 0.0 43208 2528 ? Ss 11:55 0:00 postgres: rlzy rlzy 127.0.0.1(50794) idle
postgres 6877 0.0 0.0 43208 2528 ? Ss 11:55 0:00 postgres: rlzy rlzy 127.0.0.1(50795) idle
postgres 7065 0.0 0.1 43336 4400 ? Ss 12:36 0:00 postgres: rlzy rlzy 127.0.0.1(52426) idle
postgres 7066 0.0 0.1 43324 3964 ? Ss 12:36 0:00 postgres: rlzy rlzy 127.0.0.1(52427) idle
postgres 7072 0.0 0.0 43208 2528 ? Ss 12:36 0:00 postgres: rlzy rlzy 127.0.0.1(52432) idle
postgres 7073 0.0 0.0 43204 2524 ? Ss 12:36 0:00 postgres: rlzy rlzy 127.0.0.1(52433) idle
postgres 7074 0.0 0.0 43208 2532 ? Ss 12:36 0:00 postgres: rlzy rlzy 127.0.0.1(52434) idle
postgres 7075 0.0 0.0 43208 2532 ? Ss 12:36 0:00 postgres: rlzy rlzy 127.0.0.1(52435) idle
postgres 7076 0.0 0.0 43208 2536 ? Ss 12:36 0:00 postgres: rlzy rlzy 127.0.0.1(52436) idle
postgres 7738 0.0 0.1 43592 4328 ? Ss 14:36 0:00 postgres: rlzy rlzy 127.0.0.1(53644) idle
postgres 7739 0.0 0.1 43324 3964 ? Ss 14:36 0:00 postgres: rlzy rlzy 127.0.0.1(53645) idle
postgres 7740 0.0 0.1 43324 3956 ? Ss 14:36 0:00 postgres: rlzy rlzy 127.0.0.1(53646) idle
postgres 8411 0.0 0.1 43592 4324 ? Ss 17:00 0:00 postgres: rlzy rlzy 127.0.0.1(60250) idle
postgres 8412 0.0 0.1 43324 3960 ? Ss 17:00 0:00 postgres: rlzy rlzy 127.0.0.1(60251) idle
postgres 8413 0.0 0.1 43324 3956 ? Ss 17:00 0:00 postgres: rlzy rlzy 127.0.0.1(60252) idle
postgres 8414 0.0 0.0 43208 2532 ? Ss 17:00 0:00 postgres: rlzy rlzy 127.0.0.1(60253) idle
postgres 8415 0.0 0.0 43208 2532 ? Ss 17:00 0:00 postgres: rlzy rlzy 127.0.0.1(60254) idle
postgres 8421 0.0 0.0 43208 2536 ? Ss 17:00 0:00 postgres: rlzy rlzy 127.0.0.1(60259) idle
postgres 8422 0.0 0.0 43208 2540 ? Ss 17:00 0:00 postgres: rlzy rlzy 127.0.0.1(60260) idle
postgres 8423 0.0 0.0 43208 2536 ? Ss 17:00 0:00 postgres: rlzy rlzy 127.0.0.1(60261) idle
postgres 8424 0.0 0.0 43208 2540 ? Ss 17:00 0:00 postgres: rlzy rlzy 127.0.0.1(60262) idle
postgres 8425 0.0 0.0 43208 2544 ? Ss 17:00 0:00 postgres: rlzy rlzy 127.0.0.1(60263) idle
作者: scottsiu    时间: 2009-04-10 17:41
你的客户端是不是已经打开了很多?
对于Postgres系列的数据库,每一个新的客户连接都会产生一下进程,以进行此连接的程序数据处理。
作者: 林知枫    时间: 2009-04-11 10:17
关键是没有客户端连接
我是在本机上测试的,进行第一次数据库操作后,打开了几个进程,然后不停刷新页面,进程数并没有增加,但奇怪的是,我不进行任何操作,过来一定时间,进程数就自己增加了
作者: scottsiu    时间: 2009-04-11 20:02
标题: 回复 #3 林知枫 的帖子
那这个情况基本属于见鬼了。。。!!!

是什么版本?如何安装的?如何启动的?

详细描述一下

http://www.postgresql.org/download/重新下载生新安装一下。

网站上还有
Postgres Plus:PostgreSQL的一个发行版及'LAPP', 'MAPP' and 'WAPP'打包安装版本

可以更方使安装
作者: trainee    时间: 2009-04-12 08:03
是web+postgresql的吧, 还是什么中间件,或者什么定时任务

肯定是他们在搞鬼
作者: vyouzhi    时间: 2009-04-12 11:35
情况没说明啊
作者: postgres_fan    时间: 2009-05-17 18:31
你应该看一下每个进程在执行什么SQL语句?另外,你的数据库的CPU使用率是多少?
作者: 林知枫    时间: 2009-05-21 11:32
问题已经解决了,就是没有关闭连接
这主要是我自己写了一个连接池,这个连接池本身不关闭连接,而是让连接重复使用,在用netbeans调试程序时,一重新运行项目,项目上次运行时关于连接池的记录就全部消失,所有连接都要重新建立,而数据库中的连接还在,所以,在重新运行10次项目以后,数据库的连接就满了。这是,关闭netbeans,重新启动netbeans,数据库的连接就被清空,重新运行项目就正常了




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2