From: Rudi Starcevic <rudi@oasis.net.au>
To: pgsql-admin@postgresql.org
Subject: Re: Open system files total
Date: Fri, 14 Nov 2003 11:35:29 +1000
Message-ID: <3FB43161.7010505@oasis.net.au> (raw)
In-Reply-To: <3FB42977.5@oasis.net.au>
References: <3FB42977.5@oasis.net.au>
Hi,
I think I found an easier way:
lsof -c postmaster | wc -l
lsof -u postgres | wc -l
Another option is to 'ps wwaux', then grep for postgres PIDS, then use
the 'lsof -p' option and give it a comma-separated list of postgres PIDs.
Cheers
Rudi.
Rudi Starcevic wrote:
> Hi,
>
> I'd like to know how many total system files Postgresql has open at
> any one time.
>
> Is this the easiest way ??
>
> a) Find out how many Postgres process's - `ps aux | grep postgres`
> b) For each Postgres process find out which files it has open - `ls
> /proc/*postgres_process_id*/fd | wc -l`
> c) Add up each Postgres process file open total to work out grand
> total of open files for user Postgres.
>
> I know I can get the total for the whole machine using
> /proc/user_beancounters but I'd like to know
> just for Postgres.
>
> Many thanks
> Best regards
> Rudi.
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: rudi@oasis.net.au
Subject: Re: Open system files total
In-Reply-To: <3FB43161.7010505@oasis.net.au>
References: <3FB42977.5@oasis.net.au> <3FB43161.7010505@oasis.net.au>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox