Why is jasperserver creating dozens of postgres processes?

0

Why is jasperserver creating dozens of postgres processes? I am using 5.1.0 and after new start i see this:

jasper    5082  0.5  0.2  72372 22024 ?        Ss   16:56   0:04 postgres: jasperdb jasperserver 127.0.0.1(55407) idle                                                 
jasper    5257  2.0  0.3  77800 30044 ?        Ss   16:56   0:14 postgres: jasperdb jasperserver 127.0.0.1(55440) idle                                                 
jasper    5830  2.6  0.2  73696 22000 ?        Ss   16:57   0:18 postgres: jasperdb jasperserver 127.0.0.1(55536) idle                                                 
jasper    5831  4.1  0.2  71460 19728 ?        Ss   16:57   0:29 postgres: jasperdb jasperserver 127.0.0.1(55537) idle                                                 
jasper    5832  2.6  0.3  77928 28360 ?        Ss   16:57   0:19 postgres: jasperdb jasperserver 127.0.0.1(55538) idle                                                 
jasper    5833  0.6  0.2  71548 18396 ?        Ss   16:57   0:05 postgres: jasperdb jasperserver 127.0.0.1(55539) idle                                                 
jasper    7263  1.0  0.2  71948 17772 ?        Ss   16:58   0:06 postgres: jasperdb jasperserver 127.0.0.1(55775) idle                                                 
jasper    7270  1.5  0.3  78392 26000 ?        Ss   16:58   0:09 postgres: jasperdb jasperserver 127.0.0.1(55778) idle                                                 
jasper    8068  2.5  0.3  77684 26264 ?        Ss   16:59   0:15 postgres: jasperdb jasperserver 127.0.0.1(55923) idle
 
After few days the list is few times longer. Why is it happening and what impact can it have on overall performance? It seems very weird to have THAT much db connections just to generate a report (data for reports are in MySQL anyway). I think it might be related to the fact that I have to restart jasperserver even now and then 'cause it is getting terrible slow.
g.glazewski's picture
Joined: Sep 26 2012 - 3:18am
Last seen: 8 years 4 months ago

1 Answer:

1

Hi, this is just the default way that PostgreSQL operates. I think this is the case because there is also Connection Pooling that is specified in the Application Server (ie most commonly Tomcat). And tomcat will use the connection pooling defined here: <tomcat>/webapps/jasperserver/META-INF/context.xml. This is setup to utilize multiple connections to service multiple users when tomcat is running (or other conncurrent operations such as scheduled jobs).

 

However, you can start up just PostgreSQL by itself, without Tomcat. And you will see mutiple postgres threads. I see the same pattern when just postgresql is running whether on linux, Mac, or windows. But with mysql, I usually see two or only one process.

You could try reducing max_connections and see if that changes the number. I see a lot of discussion about increasing max_connections but very little about decreasing them.

 

  http://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server

tkavanagh's picture
4962
Joined: Jul 7 2006 - 8:54am
Last seen: 7 years 4 months ago

Thank you for the exhausting answer!

g.glazewski - 8 years 4 months ago
Feedback
randomness