Re: How to troubleshoot high mem usage by postgres?

From: Tom Lane
Subject: Re: How to troubleshoot high mem usage by postgres?
Date: ,
Msg-id: 9487.1267375359@sss.pgh.pa.us
(view: Whole thread, Raw)
In response to: Re: How to troubleshoot high mem usage by postgres?  (Chris)
List: pgsql-performance

Tree view

How to troubleshoot high mem usage by postgres?  (Chris, )
 Re: How to troubleshoot high mem usage by postgres?  (Ben Chobot, )
  Re: How to troubleshoot high mem usage by postgres?  (Chris, )
   Re: How to troubleshoot high mem usage by postgres?  (Tom Lane, )
 Re: How to troubleshoot high mem usage by postgres?  (Craig Ringer, )
  Re: How to troubleshoot high mem usage by postgres?  (Chris, )
 Re: How to troubleshoot high mem usage by postgres?  (Tom Lane, )

Chris <> writes:
> @Tom Lane:
> As I mentioned above I am not doing everything in a single
> transaction. However I do want to try your suggestion regarding
> getting a "memory context map". But I'm afraid I don't know how to do
> what you are describing. How can I set the ulimit of postmaster?

Depends on the script you are using to start the postmaster.  One way is
to call ulimit in the startup script right before it invokes the
postmaster.  However, if you have something like

    su - postgres -c "postmaster ..."

then I'd try putting it in the postgres user's ~/.profile or
~/.bash_profile instead; the su is likely to reset such things.

> And
> does the postmaster stderr output go to the postgres log file?

Also depends.  Look at the startup script and see where it redirects
postmaster's stderr to.  You might have to modify the script --- some
are known to send stderr to /dev/null :-(

Sorry to be so vague, but different packagers have different ideas
about how to do this.

            regards, tom lane


pgsql-performance by date:

From: Josh Berkus
Date:
Subject: Re: [HACKERS] full text search index scan query plan changed in 8.4.2?
From: Josh Berkus
Date:
Subject: Re: partitioned tables query not using indexes