X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 86A51D1B4FE for ; Fri, 14 Nov 2003 01:28:43 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 76831-05 for ; Thu, 13 Nov 2003 21:28:15 -0400 (AST) Received: from water.oasis.net.au (water.oasis.net.au [210.8.139.2]) by svr1.postgresql.org (Postfix) with ESMTP id CAD80D1B4E9 for ; Thu, 13 Nov 2003 21:28:10 -0400 (AST) Received: from oasis.net.au (guardian [210.8.139.5]) by water.oasis.net.au (8.9.3/8.9.3/Debian 8.9.3-21) with ESMTP id MAA30046 for ; Fri, 14 Nov 2003 12:02:16 +1000 X-Authentication-Warning: water.oasis.net.au: Host guardian [210.8.139.5] claimed to be oasis.net.au Message-ID: <3FB43161.7010505@oasis.net.au> Date: Fri, 14 Nov 2003 11:35:29 +1000 From: Rudi Starcevic User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: Re: Open system files total References: <3FB42977.5@oasis.net.au> In-Reply-To: <3FB42977.5@oasis.net.au> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200311/262 X-Sequence-Number: 11249 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) >