javauser71
javauser71

Reputation: 5249

Why so many "postgres.exe" are created when I run my application?

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".

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.

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.

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.

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

Upvotes: 17

Views: 34560

Answers (1)

Frank Heikens
Frank Heikens

Reputation: 127056

Yes, this is normal. From the manual:

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.

Upvotes: 24

Related Questions