Re: "Out of memory" errors..

From: "Lim Berger" <straightfwd007(at)gmail(dot)com>
To: "Sander Steffann" <s(dot)steffann(at)computel(dot)nl>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Postgresql General List" <pgsql-general(at)postgresql(dot)org>
Subject: Re: "Out of memory" errors..
Date: 2007-08-14 02:47:39
Message-ID: 69d2538f0708131947l45f7f110i32e247d214701749@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 8/14/07, Sander Steffann <s(dot)steffann(at)computel(dot)nl> wrote:
> Hi Lim,
>
> >> It might also be in /etc/security/limits.conf.
> >
> > Thanks. I see these two lines in that file:
> >
> > postgres soft nofile 8192
> > postgres hard nofile 8192
> >
> > How should I change these values? I am not sure how this reflects the
> > "ulimit" options.
>
> Those are limits to the allowed number of open files (ulimit -n). I think
> 8192 should be enough for PostgreSQL. The problem you had were related to
> other settings, so if only the "nofile" setting is changed your strange
> ulimits do not come from here :-)

I think I have located the problem. It is in "/etc/profile" where some
ulimits are added. This is the offending text, I think:

#********************* cPanel Added Limit Protections -- BEGIN

#unlimit so we can run the whoami
ulimit -n 4096 -u 14335 -m unlimited -d unlimited -s 8192 -c 1000000
-v unlimited 2>/dev/null

LIMITUSER=$USER
if [ -e "/usr/bin/whoami" ]; then
LIMITUSER=`/usr/bin/whoami`
fi
if [ "$LIMITUSER" != "root" ]; then
ulimit -n 100 -u 20 -m 200000 -d 200000 -s 8192 -c 200000 -v
200000 2>/dev/null
else
ulimit -n 4096 -u 14335 -m unlimited -d unlimited -s 8192 -c
1000000 -v unlimited 2>/dev/null
fi
#********************* cPanel Added Limit Protections -- END

I am not much of a shell scripter so I am afraid of breaking this, but
how can I change the line "if [ "$LIMITUSER" != "root" ];" to include
the postgres user as well? Can I do something like:

if [ "$LIMITUSER" != "root" and "$LIMITUSER" != "postgres" ];

Would appreciate any thoughts!

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ow Mun Heng 2007-08-14 02:50:33 Copy command and duplicate items (Support Replace?)
Previous Message Lim Berger 2007-08-14 02:41:03 Postgresql INSERT speed (how to improve performance)?