Обсуждение: Too many postgres.exe

Поиск
Список
Период
Сортировка

Too many postgres.exe

От
Дата:

Hi All,

 

I have my application UI in Java and which is communicating with Postgresql database.

However whenever my application is running I could see there are too many postgres.exe are created even though the application is not doing anything in database.

 

In general the observation is  that there are too many progress.exe processes get created every time I run my application and it postgres.exe eats up the maximum memory.

 

Any help/suggestion please!!

 

Re: Too many postgres.exe

От
Craig Ringer
Дата:
On 15/12/2009 5:51 PM, A.Bhattacharya@sungard.com wrote:

> However whenever my application is running I could see there are too
> many postgres.exe are created even though the application is not doing
> anything in database.

What is "too many" ?

What does:

   SELECT * FROM pg_stat_activity;

show?

How are you talking to PostgreSQL? Direct JDBC? An ORM like Hibernate?
Which one? What JDBC driver version? Are you using a connection pool?
Which one?

The people on this mailing list are, with the possible exception of Tom,
not psychic. Some kind of details will help your question get a better
answer, more quickly. See:

   http://wiki.postgresql.org/wiki/Guide_to_reporting_problems

> In general the observation is that there are too many progress.exe
> processes get created every time I run my application and it
> postgres.exe eats up the maximum memory.

Then your server is not configured correctly. Set max connections,
shared_buffers, work_mem, maintenance_work_mem, etc so that your server
cannot consume too much memory.

--
Craig Ringer

Re: Too many postgres.exe

От
Thomas Kellerer
Дата:
A.Bhattacharya@sungard.com, 15.12.2009 10:51:
> Hi All,
>
> I have my application UI in Java and which is communicating with
> Postgresql database.
>
> However whenever my application is running I could see there are too
> many postgres.exe are created even though the application is not doing
> anything in database.
>
> In general the observation is that there are too many progress.exe
> processes get created every time I run my application and it
> postgres.exe eats up the maximum memory.

Define "too many".

Each connection that you open will start up a new postgres.exe

As Craig has already pointed out you have not specified enough details, so people can only guess what is going wrong
(ifat all) 

My best guess is:

- you are simply not closing your connections when you are don
- you have configured a connection pool that creates a high number of initial connections

Thomas

Re: Too many postgres.exe

От
Howard Cole
Дата:
A.Bhattacharya@sungard.com wrote:
>
> Hi All,
>
>
>
> I have my application UI in Java and which is communicating with
> Postgresql database.
>
> However whenever my application is running I could see there are too
> many postgres.exe are created even though the application is not doing
> anything in database.
>
>
>
Have you defined a connection pool? It is possible that the connections
are part of a pool and will be created when your application starts. You
should be able to change the minimum/maximum pool size.

Howard
www.selestial.com

Re: Too many postgres.exe

От
Scott Mead
Дата:
On Tue, Dec 15, 2009 at 4:51 AM, <A.Bhattacharya@sungard.com> wrote:

Hi All,

 

I have my application UI in Java and which is communicating with Postgresql database.

However whenever my application is running I could see there are too many postgres.exe are created even though the application is not doing anything in database.

Remember, every connection gets a 'postgres.exe' (dedicated backend per connection).  And it'll stick around until you close the connection.  If you create a connection and don't close it until the DB goes away, then you'll still have the backend process there even though you're not doing anything.


Can you describe what you consider 'Too Many?' The process-per-connection architecture is very common (albeit not on windows), so I'm curious what your threshold is. 

 

 

In general the observation is  that there are too many progress.exe processes get created every time I run my application and it postgres.exe eats up the maximum memory.


You'll need to use sysinternals tools here, task manager mis-reports how much memory is actually being allocated by postgres.  This is because each postgres.exe is attaching to a shared memory area.  This means that you could be using 2 GB of memory (total) for your postgres database, when it looks like you're using 20 GB of memory. (10 backends all showing 2 GB).  The reality is... you're not using (mem * num of postgres.exe), you should use sysinternals tools to discern how much memory is shared vs. per-backend.

--Scott

 

Any help/suggestion please!!