Re: OperationalError: FATAL: could not open file <filename>: Too many open files in system

From: Erik Jones <ejones(at)engineyard(dot)com>
To: Ben Welsh <ben(dot)welsh(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: OperationalError: FATAL: could not open file <filename>: Too many open files in system
Date: 2009-04-24 16:31:41
Message-ID: 0433C9C0-37DF-48C9-BAF1-83F734F8DB9E@engineyard.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Apr 23, 2009, at 1:39 PM, Ben Welsh wrote:

> Hello,
>
> I'm managing a pgsql->django->mod_python->apache machine that serves
> no media, but handles postgres, memcached and apache all by itself.
>
> Recently I've begun drawing "too many open files in the system"
> errors, as seen in the subject line.
>
> Browsing the postgres documentation, I suspect that I need to lower
> my `max_files_per_process` from the default 100. But the support
> team at my host is pointing the finger at memcached.
>
> Before I do anything, I thought I'd consult the experts here on the
> list and see whether you can had any opinions. Here are some of the
> basic config settings that, from cruising around the web and talking
> to listservs, I've come to suspect are crucial to this sort of
> problem. Really, any advice is appreciated, because I've been
> getting competiting advice from different sources and I'm not sure
> exactly where to go with this.
>
> And, of course, thanks listers and developers for such a great
> product and community.
>

<snip>

> $ lsof | awk '{print $1}' | sort | uniq -c
> 1 COMMAND
> 10 awk
> 49 bash
> 17 crond
> 5154 httpd
> 9 init
> 25 lsof
> 39 memcached
> 807 postmaste
> 62 saslauthd
> 69 sendmail
> 28 sh
> 7 sort
> 183 sshd
> 13 syslogd
> 8 uniq
> 19 xinetd

I'd start by investigating the 5K+ file descriptors held by Apache.

Erik Jones, Database Administrator
Engine Yard
Support, Scalability, Reliability
866.518.9273 x 260
Location: US/Pacific
IRC: mage2k

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Filip Rembiałkowski 2009-04-24 16:53:01 Re: need help for PostgreSQL consistency check mechanism
Previous Message Sam Mason 2009-04-24 16:15:02 Re: deleting function