为什么会有这么多的“ postgres.exe”?运行我的应用程序时创建的? [英] Why so many "postgres.exe" are created when I run my application?

查看:381
本文介绍了为什么会有这么多的“ postgres.exe”?运行我的应用程序时创建的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个J2EE应用程序,已部署在 Windows(Vista 32位)平台的JBoss6应用程序服务器中。我的数据库是 PostgreSQL 9.0.4 ,并且我正在使用JDBC驱动程序: postgresql-9.0-801.jdbc4.jar。

I have a J2EE application, deployed in JBoss6 application server in Windows (Vista 32 bit) platform. My database is "PostgreSQL 9.0.4" and I am using JDBC driver: "postgresql-9.0-801.jdbc4.jar".

在我的ds.xml文件中,我定义了 max-pool-size = 75 和min-pool-size =40。
i是使用JPA / Hibernate以及javax.sql。数据源。

In my ds.xml file, I have defined max-pool-size = 75 and min-pool-size = 40. i am using JPA/Hibernate as well as using javax.sql.DataSource.

在Windows任务管理器中,我发现PostgreSQL服务器启动时会创建 6个 postgres.exe进程
现在,当我在JBoss中部署/启动我的J2EE应用程序时,我发现总共总共66 个 postgres.exe进程。
,这意味着由于我的应用程序启动而又产生(或启动了)另外 60个postgres进程

In windows "Task Manager", I find that when PostgreSQL server starts up it creates 6 "postgres.exe" processes. Now when I deploy/start my J2EE application in JBoss, I find a total of 66 "postgres.exe" processes. So that means another 60 postgres processes were spawned (or launched) because of my application started.

如果我更改了<如果将strong-max-pool-size 设置为 40 ,那么我注意到我总共有 46个postgres.exe进程
在两种情况下都不会。当我停止J2EE应用程序时,postgres进程的数量减少到6。

If I change the max-pool-size to be 40 then I notice that I have a total of 46 postgres.exe processes. In both cases the no. of postgres processes comes down to 6 when I stop my J2EE application.

所以我的问题是正常的吗?
是由于连接池(由Hibernate使用)而产生/启动了那些多余的进程吗?

So my question, is this normal? Are those extra processes spawned/launched because of 'connection pooling' (used by Hibernate)?

推荐答案

是的,这个是正常的。从手册

Yes, this is normal. From the manual:


PostgreSQL服务器可以处理来自
客户端的多个并发连接。为此,它开始( forks)每个
连接的新过程
。从那时起,客户端和新服务器进程
进行通信,而无需原始postgres进程进行干预。
因此,主服务器进程始终在运行,等待客户端
连接,而客户端和关联的服务器进程来了,
走了。

The PostgreSQL server can handle multiple concurrent connections from clients. To achieve this it starts ("forks") a new process for each connection. From that point on, the client and the new server process communicate without intervention by the original postgres process. Thus, the master server process is always running, waiting for client connections, whereas client and associated server processes come and go.

这篇关于为什么会有这么多的“ postgres.exe”?运行我的应用程序时创建的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆